flixel icon indicating copy to clipboard operation
flixel copied to clipboard

FlxTileBlock did not work on mac target or ios

Open Taliii opened this issue 14 years ago • 16 comments

A sprite sheet that works fine on flash will not load properly on mac, ios. On game, it shows pixels from the next frame, and cuts off pixels from the current frame.

I'm use last version of Fixel, NME and Haxe.

Taliii avatar Jun 29 '12 22:06 Taliii

can you provide simple example (with code) of your problem?

Beeblerox avatar Jun 30 '12 03:06 Beeblerox

@Talii I uploaded possible fix for your problem to repo. Can you download updated FlxTileblock class and place it instead of old version of file? And please let me know if it helped you or not

Beeblerox avatar Jun 30 '12 04:06 Beeblerox

@Beeblerox Same problem :-(

Taliii avatar Jun 30 '12 07:06 Taliii

Code example :

    var groundTop:FlxTileblock = new FlxTileblock(positionStartGround, y, width, height);
            groundTop.loadTiles("assets/images/groundTop.png");
            groundTop.solid = groundTop.immovable = true;
            add(groundTop);

            var groundT:FlxTileblock = new FlxTileblock(positionStartGround, Std.random(Lib.current.stage.stageHeight) - 200, width, height);
            groundT.loadTiles("assets/images/groundTop.png");
            add(groundT);

            var groundMiddle:FlxTileblock = new FlxTileblock(positionStartGround, y, width, 200);
            groundMiddle.loadTiles("assets/images/groundCenter.png");
            groundMiddle.x = positionStartGround;
            groundMiddle.y = y + groundTop.height;
            add(groundMiddle);

            groupCollision.add(groundT);
            groupCollision.add(groundTop);

Taliii avatar Jun 30 '12 07:06 Taliii

If it helped you, two screen flash and mac version : http://fbe.am/91U

Taliii avatar Jun 30 '12 09:06 Taliii

ok. will work further. hope I'll find the source of problem today

Beeblerox avatar Jun 30 '12 09:06 Beeblerox

@Talii two more questions: what is the size in pixels of images you loading to FlxTileblocks? and what is the size of these FlxTileBlocks? Maybe it will help me to find problem

Beeblerox avatar Jun 30 '12 10:06 Beeblerox

@Talii and last question: and what are 'width' and 'height' parameters (in pixels) passed to the loadTiles() method

Beeblerox avatar Jun 30 '12 11:06 Beeblerox

"@Talii and last question: and what are 'width' and 'height' parameters (in pixels) passed to the loadTiles() method" : same problem ;-)

"@Talii two more questions: what is the size in pixels of images you loading to FlxTileblocks? and what is the size of these FlxTileBlocks? Maybe it will help me to find problem" 8, 16, 64, all of these settings doesn't work

Taliii avatar Jun 30 '12 12:06 Taliii

@Talii Maybe you didn't understand my questions, but I just want to know the size of images "groundTop.png" and "groundCenter.png" in pixels (for example, 128 by 64 pixels) and what are 'width' and 'height' parameters in your code example

Beeblerox avatar Jun 30 '12 12:06 Beeblerox

I did test resize images "groundTop" on 32, 64, 128 pixels size and also parameters on loadGraphic.

Envoyé de mon iPhone

Le 30 juin 2012 à 14:36, [email protected] a écrit :

@Talii Maybe you didn't understand my questions, but I just want to know the size of images "groundTop.png" and "groundCenter.png" in pixels (for example, 128 by 64 pixels) and what are 'width' and 'height' parameters in your code example


Reply to this email directly or view it on GitHub: https://github.com/Beeblerox/HaxeFlixel/issues/83#issuecomment-6684957

Taliii avatar Jun 30 '12 12:06 Taliii

@Talii It is still not clear to me. Can you send me these graphic files for tileblocks or dummy files with the same size and visible borders of tile's frames.

Sorry for my dullness

Beeblerox avatar Jun 30 '12 15:06 Beeblerox

@Beeblerox You find all source of my project here : http://fbe.am/92x. Good luck, thx u

Taliii avatar Jun 30 '12 16:06 Taliii

@Talii I think I found problem but uncertain since I work on windows. I changed color depth of images in asset folder to 32-bit (I think that your was 8-bit) and they became visible correctly on cpp target. I think that it is a NME 's restriction to image files. I changed your code a bit (OnTheRun.nmml and World.hx files only) so it works little nicer. I've added some comments to these changes. You can download changed project archive here: http://fbe.am/92G Please remove all files in "Export" folder before new compilation. Hope it will solve your problem

Beeblerox avatar Jun 30 '12 17:06 Beeblerox

@Beeblerox, Great work ! Exactly, working fine now. I didn't know NME's restriction on image files, sorry... Thanks for another code change ;-)

Taliii avatar Jun 30 '12 17:06 Taliii

@Talii Anytime :)

Beeblerox avatar Jun 30 '12 18:06 Beeblerox