Weird discrepancy between scene size & background image size

SinequanonSinequanon Member Posts: 35
edited November -1 in Working with GS (Mac)
Hi,

I'm working on an iPad title with GS. I have an image that is 3072 x 768 (3 screens wide by 1 screen tall in landscape). The background image moves after every stage by 1024 pixels. Currently, I have the background spawning as an actor when the level 01 actor (which is running enemy spawning and such) calls for it at the beginning of the level.

However, if I set the image actor to spawn at 0 (relative to scene), it actually spawns 1536 pixels into the image (1024 + another 512), roughly. If I set it to spawn at -1536, it doesn't spawn at all. For some reason, if I set it to spawn at 1523 pixels, it will stay on the screen, but at 1524, it disappears. I can work around this, I suppose, but moving it approximately 1020 pixels each time, but ideally, I'd like the game to work with my actual image. What could be causing the discrepancy?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    When using spawn the X and y coordinates it uses are either relative to the Scene or the Actor. You set that in the drop down menu. When using relative to the scene it using the x and y system the scene uses mean (0,0) is bottom left corner. However if you are using relative to actor then (0,0) starts from the center point of the actor.

    Although you may be having some issues with you art work too since the largest image file you can have in GS is 1024x1024 its possible you are experiencing some issues with the resizing GS would do to a 3072 wide image.

    I would check the relative to selection you have cause it sounds like you have it set to actor though. Sorry if that doesn't help or if i'm not seeing your actual problem. MAybe some screen shots or video of your problem would help better understand
  • SinequanonSinequanon Member Posts: 35
    The engine resized my artwork down, and I manually changed the size in the size attributes for the actor. The actor is being spawned relative to the scene. Currently, I have it spawning at X: 1534, Y: 384. The Y coordinate makes sense, the center point of a 768 image is 384. The X value is strange. When X is 0, it corresponds on the image to the point that should be +512. So given that, the +512 - 1024 should give me the correct center value for the first 3rd of the screen, but it doesn't.

    In any case, through a lot of tinkering, I've gotten it to work (though the values are more hacked at than finessed). How, though, would someone make a side-scrolling game with a panoramic background in GS, given the 1024x1024 limitation?
Sign In or Register to comment.