Author Topic: Strange error sprites stretch only on iPhone (iPad OK)  (Read 2588 times)

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Hi!

I detect a problem in the painting of Sprites. This is a "error" that only happens on my iPhone 3G 16Gb, in the case of the iPad 32Gb, no problem.


I explain my procedure for paint and the error observed:

First of all I load and image using LOADSPRITE. The image has 1280x480(x256) pixels, PNG format.
My idea is to use this image for "tutorial screen's", separated on 4 "pages" (1280/4=320 pixels).

I paint the image at 0,0 position for "first page". Wait tap and change the X position for show the "second page"... painting image at -320,0 pixels...

Well, please view the images and the strange stretch observed on iPhone (image appears as DOUBLE of horizontal size) . Other platforms such iPad, Win32... works perfectly.

Any idea?

 :blink:

TIA, Hark0

P.S. You can view a video sample on iPad of my project in my blog... without any sprite error.



[attachment deleted by admin]
« Last Edit: 2010-Aug-17 by Hark0 »
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 929
  • KodeSource
    • View Profile
    • KodeSource
Weird!
Does it still do that if you use 'LOADANIM' and 'DRAWANIM' specifying the 'page' number as the animation frame?

Is the iPad version of the app in native iPad mode (4x the resolution), or simulated iPhone mode (stretched)?

[Edit]
I see by your iPad image dimensions that it is probably in 320x480 mode.
« Last Edit: 2010-Aug-17 by Slydog »
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
You have passed the limit of 1024x1024 texture size which causes this weird behavior. I had experienced the same. You might ask why it works on IPad as it has 2048x2048 limit ;).

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
hmmm...

Thanks to both for the comments.

@Slydog: The images are captured directly on the devices... first iPhone, second iPad. I need SOME graphics for my project... this is because I use one PNG for various "pages".

@Ozden79: I think too this is the problem. Maybe I try PNG with only "2 pages". (My initial idea are create a PNG with more than "10 pages").

Interesting question: Where is the size+profundity color of the images for use??? Depends of RAM?

H.
« Last Edit: 2010-Aug-18 by Hark0 »
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
The texture size limit depends on device generation as far as I know and not something related with RAM or something. 3GS and above has 2048x2048 where the older one has 1024x1024. To overcome this limit, you need to load multiple textures using LOADANIM and choose the right one to draw depending on your image index on your code.

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
... you need to load multiple textures using LOADANIM and choose the right one to draw depending on your image index on your code.

Yes, I think this is the best solution. :)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic