Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Advanced Sprites screen location issue

Author
Message
JoeOh
13
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 9th Dec 2010 19:50
I am using the Sprite Pack feature in Advanced Sprites. My issue is when I have an bitmap image that measures 25x25 pixels that I made in gimp so I know it's actual size. Here's the code:



When I use this code I expect the two 25x25 tiles next to each other not overlapping or separated. But when the program is ran, the 2 tiles are clearly overlapping each other. What gives?

Thanx-

Home is where my souped-up computer is...
Ashingda 27
14
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 10th Dec 2010 04:29 Edited at: 10th Dec 2010 04:30
What happens if you separate it farther?


I'm sure the draw sprite statement isn't the problem. Maybe you are missing some steps while setting up the sprite or while rending the pack. If you could show your sprite setup and render codes it'll help more.

Have you also tried using different image format like Jpeg, Png, etc?

JoeOh
13
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 10th Dec 2010 19:05
I am now using the PNG format and the location problem still happens. Even though they tiles are 25x25, I have to separate them to 32x32 so they wont either overlap or be separated.

What other steps may I be missing? whats the usual culprit?

Home is where my souped-up computer is...
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 10th Dec 2010 19:32
Sounds like it's stretching the surface to the nearest power of 2. Perhaps there's a flag to stop this ?

miso
12
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 10th Dec 2010 19:45
You can ask the sprite size with command DXS GET SPRITE WIDTH and DXS GET SPRITE HEIGHT.

If you dont want, you may use the following method.

SPRITE_SIZE=IMAGE_SIZE*1.25

OR you can rescale the sprite, but thats not adviced.



No place like 127.0.0.1 .
Ashingda 27
14
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 10th Dec 2010 19:59 Edited at: 10th Dec 2010 20:03
The problem isn't with the Advanced Sprites at all, it is the way you load your images.
Highlight or click the LOAD IMAGE statement and press "F1", read up on the Texture Flag. To keep your Image pixel perfect you would want to load your image with a texture flag of 1:


Now on the other hand you may also skip this step entirely and just load it directly to the Advanced Sprite:


JoeOh
13
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 10th Dec 2010 20:17
Adding the "1" to the load image command did the trick. Even though it worked, I will replace the LOAD IMAGE command with the DSX CREATE SPRITE("image.png") command to avoid any more unexpected quirks.

Home is where my souped-up computer is...
miso
12
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 10th Dec 2010 20:23 Edited at: 10th Dec 2010 20:24
Hmm, thats strange, I experienced the problem, but i always load my as images with DXS CREATE SPRITE("image.png")...

No place like 127.0.0.1 .

Login to post a reply

Server time is: 2022-11-27 06:25:50
Your offset time is: 2022-11-27 06:25:50