www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: 9kaywun on June 16, 2012, 10:30:51 am

Title: Rendering Textures over 256x256?
Post by: 9kaywun on June 16, 2012, 10:30:51 am
When I render a sprite such as this one: http://troll.ws/i/hOjXrL.png it comes out deformed on the game screen.. How can I render it to be the same size as the actual image?

Code used to render the sprite.. (works fine with sprites under 256x256)
getBuffer().blit(TextureManager.getInstance().getTexture("chatbox"), 0, 0, (int) x, (int) y, X, Y, FrameBuffer.OPAQUE_BLITTING);
Title: Re: Rendering Textures over 256x256?
Post by: EgonOlsen on June 16, 2012, 10:36:01 am
Depends on what you use for X and Y...
Title: Re: Rendering Textures over 256x256?
Post by: 9kaywun on June 16, 2012, 10:53:36 am
Depends on what you use for X and Y...

Disregard the naming, X and Y are size variables and are equal to the dimensions of the chatbox sprite.
Title: Re: Rendering Textures over 256x256?
Post by: EgonOlsen on June 16, 2012, 12:10:23 pm
Should actually work then...if you scale the sprite to a width and height that are powers of 2. Everything else will be scaled to 256*256...maybe that's your problem!?