I'm making a card game, the problem is when i move a card to the bottom-right of the window game:
Card MoveTo (WindowWidth, WindowHeight)
this didn't work accurately:
However when i move it to 0,0 like that:
Card MoveTo (0, 0)
The card is well moved to the 0,0:
Can anyone explain how to solve this ?
PS: I'm running with fullscreen LetterBox scale, margin set to 0,0 and the image point is set to the top-left of each cards.
Fixed using LayoutWidth & LayouHeight or ViewPort.....
But still wonder why just WindowWidth & WindowHeight gives me a wrong Size?
I had some problems with this at first, there are some more detailed answers on the forums. I always make sure that I get my own values whenever I need them, using layoutright(layer) - layoutleft(layer) or something similar.
farflamex: Can you put some links regarding this subject?
Thanks in advance
Not sure I have any links, but where are you stuck? If you use layoutright(mylayer) - layoutleft(mylayer) you'll get the correct width of your window, unless you've done some other changes (not sure if it works if that layout is scaled/zoomed etc).
Develop games in your browser. Powerful, performant & highly capable.
WindowWidth and WindowHeight give the pixel size of the view. With "fullscreen in browser" set to "off" the values will be identical to the viewport size.
R0J0hound the point of having such variables is that they should work even with fullscreen ON...
Must be reported as a bug ?
It's not a bug, when I was confused about it, Ashley set me straight. Now I just use the layout values to find the width and height, since it's always correct and up to date (perhaps not if you zoom, I don't know).