Are the sprite/spritesheet size limits different on windows target?

161 views
Skip to first unread message

Jesse Abram

unread,
Jul 19, 2015, 3:19:03 PM7/19/15
to haxef...@googlegroups.com
I'm working on getting my game working in windows (I've always targeted Flash previously) and I've got a couple of extremely wide sprites that are refusing to appear (the other sprites all seem to be appearing as normal).
If it is, indeed, a limit in how wide the sprite can be, does anyone know what that limit is, or why the windows target would be more restrictive than the Flash one?
Also, is there a way around it that doesn't involve chopping it into pieces?
Thanks!
Bonus question: Why doesn't this forum allow me to use "windows" as a tag? It straight up says "invalid tag" when I try.

SruloArt

unread,
Jul 19, 2015, 4:14:15 PM7/19/15
to haxef...@googlegroups.com
How wide? You can trace the max texture size your GPU supports by adding:
trace(FlxG.bitmap.maxTextureSize);
This property will only be available on non-Flash targets (like Neko).

As a general rule, Flash supports much smaller texture sizes than what your GPU on Windows/Neko supports (More if it's Stage3d, which is unlikely in your case), so I doubt your issue is really about how wide your texture is. However, on Windows, HaxeFlixel uses a different rendering system (http://haxeflixel.com/blog/01-HaxeFlixel-rendering/) than what Flash uses (blitting) so maybe the problem is actually there.

There are many ways around many things, but they rely on the specific problem you are faced with: How wide are they? What are they for?

And I have no idea about the Windows tag.

Jesse Abram

unread,
Jul 19, 2015, 5:30:00 PM7/19/15
to haxef...@googlegroups.com
I tried FlxG.maxTextureSize and it gives me: "flixel.system.frontEnds.BitmapFrontEnd has no field maxTextureSize"
The sprites are 9600 pixels wide, and only a few pixels tall. They're only about 6k. I'm using them as a moving ocean that extends the length of the level.

SruloArt

unread,
Jul 20, 2015, 6:05:00 AM7/20/15
to haxef...@googlegroups.com
Hmm, sorry this is only available on the dev branch, but you can use the same process:
import openfl.gl.GL;
...
trace(GL.getParameter(GL.MAX_TEXTURE_SIZE));

An Ocean? that's probably the best thing to optimize in a video game :) Here are 2 ways you can try: 
* Use FlxBackDrop - Create a repeating image of your ocean that fits your actual game window (let's say, 1920X1080, but it can be a lot smaller), and then just let it be repeated. (https://github.com/HaxeFlixel/flixel-addons/blob/master/flixel/addons/display/FlxBackdrop.hx). You're going to need to unblock the flixel-addons tag in your project.xml if you want this class to be available.
* Use Tiles - The most obvious solution: you open OGMO or Tiled, rebuild your ocean as a tilemap using tiles (ShoeBox actually generates a .tmx file for you from an image), and then place the tilemap in your level. The catch here is that you need to think about how the tiles fit together.

In both methods you add randomness by code (like, you randomly add a buoy somewhere within certain bounds). Don't use 9600 pixels wide textures unless you're working on a LOTR style movie :D

Jesse Abram

unread,
Jul 20, 2015, 12:06:12 PM7/20/15
to haxef...@googlegroups.com
Thank you for the help, I'll research up!

Jesse Abram

unread,
Jul 20, 2015, 3:42:36 PM7/20/15
to haxef...@googlegroups.com
The maxTextureSize was indeed the issue - Flash supports wider sprites than my Windows system does (the Windows limit is 8192)
Reply all
Reply to author
Forward
0 new messages