im new for games in android and it starts and starts and encounters a problem when using createTiledFromAsset the code in which the im problem occurs is
@Override public void onLoadResources() { mBitmapTextureAtlas = new BitmapTextureAtlas(128, 128, TextureOptions.BILINEAR); BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/"); mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory .createTiledFromAsset(this.mBitmapTextureAtlas, this, "move.png", 0, 0, 10, 1); mEngine.getTextureManager().loadTexture(mBitmapTextureAtlas); } @Override public Scene onLoadScene() { mEngine.registerUpdateHandler(new FPSLogger()); mMainScene = new Scene(); mMainScene .setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f)); player = new AnimatedSprite(0, 0, mPlayerTextureRegion); mMainScene.attachChild(player); return mMainScene; }
im does not get an error, since my BitmapTextureAtlas has a value of 128 * 128, and each tile part coming from createTiledFromAsset should have a value of 78 * 85, since the arguments passed to it are 1 row and 10 columns, and the original image is 779 * 85 this means that when the width is tiled up to 10 parts, then 779/10 = 78, the width of which will be equal to the width of each tile part, and since the line is 1, therefore 85/1 = 85, therefore, the width * of the height of each tile the details that should be placed on the BitmapTextureAtlas is 78 * 85, and the BitmapTextureAtlas itself has p zmer 128 * 128, why an error saying Supplied pTextureAtlasSource must not exceed bounds of Texture happening here ...? or they donโt understand the actual functions ...? if im wrong, then how does the createTiledFromAsset ........ process work?
source share