Weird bug with graphics positioning.

mataruamatarua Auckland, New ZealandMember Posts: 854
I have set up a bunch of progress bars and blobs at the end that activate on a certain level.

They all were fine and working perfectly - and aligned by me to the pixel - bar is 4px high located at Y 50px - blob is 10px high located at 50px - all sweet as working and aligned properly.

But I wanted to move them both down - I did this through the scene and layer selector - choosing the many progress bars and blobs for 20 different levels (40 objects) and shift-nudged them all down 10px for layout changes.

So they all sit at 40px now instead of 50px.

But my 10px blob is now too low. So I nudge it up one pixel. It's too high. So I nudge it down one pixel - check position - bang on 40px - sits too low.

I take it in to photoshop for high and low as I see it and yes, it's moving to high and then too low when it moves one pixel.

So I move it to 40.5 and it becomes perfect - when in fact that's wrong - and a hack.

Not sure what to do - I have two colour shifted elements for 10 items and makes 40x changes which with the current interface is painful and time consuming.

Anyone experienced anything like this before? Things do not sit where you tell them to sit on the stage?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    Anyone experienced anything like this before? Things do not sit where you tell them to sit on the stage?
    @matarua

    Yes, I've had this issue on one of my projects, it was a long time ago so I can't remember the solution off the top of my head, but I do know that if you set your actors at 15.1 (rather than 15 or even 15.5) it solves the issue.

    I'll try and dig out later the project and see if I can remember anymore about this issue.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Think it only happens if the actor is movable? i remember this from a while back...i think lol.

    Darren.
  • SocksSocks London, UK.Member Posts: 12,822
    Think it only happens if the actor is movable? i remember this from a while back...i think lol.

    Darren.
    @DeepBlueApps

    I think you're right, having movable switched on had something to do with it, if you switch movable off it solves the issue as far as I rememberer, but of course you then are limited with how you can move the actor - as well as effecting collisions.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Thanks guys I will try that! Much appreciated :)
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Just an update i have made the change and you guys were right - that fixed it - thanks so much I really appreciate the tips :)

    From here i will also make sure i do this to all non-movable objects - I know that is a good optimisation for performance anyway - but with this added incentive - it seems to be a must do!

    Cheers, M@
  • ericzingelerericzingeler Member Posts: 334
    Just throwing this out there as it could be helpful in the future... the midpoint of a number is the median, not half. In the case of 10, the midpoint is not 5 but instead 5.5

    1 2 3 4 5 [midpoint] 6 7 8 9 10
    median of 10 = (the sum of the two closest to the middle value of 10)/2 = (5+6)/2 = 11/2 = 5.5

    or the faster way

    m = (n + 1)/2
    = (10 + 1)/2
    = 11/2
    = 5.5

    or in reverse

    n = (2 * m) - 1
    = (2 * 5.5) - 1
    = 11 - 1
    =10


    for m = 5, find n

    n = (2 * 5) - 1
    = 10 - 1
    = 9

    In any case, I can't tell you exactly how this relates to your case, but it may have something to do with it.
  • SocksSocks London, UK.Member Posts: 12,822
    @ericzingeler

    Insightful. :)>-
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Yep I was wondering if - since Gamesalad can work to 1.0000 pixels - is the midpoint in between?

    It is when it's retina display - that works as such - the stage of every device is an even number - so the center which is how GS works out actor positions has to be able to divide the stage up to four and give the exact center which is not a pixel but the void between four sections.

    So the maths that is above thanks to @ericzingeler may be exactly how things are worked out - that's cool to see - and thanks so much for your help guys - I was cursing last night I tell ya!

    Forum legends to the rescue :) Thanks you guys!
Sign In or Register to comment.