Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sokaroka

Pages: [1]
1
Graphics / Re: Sprite getPosition function giving wrong y value.
« on: September 07, 2013, 05:49:47 pm »
I'm still getting the same problem.

EDIT: I changed the player texture to 32x32 instead of 32x27 and now it's off by a different amount.

2
Graphics / Re: Sprite getPosition function giving wrong y value.
« on: September 07, 2013, 05:43:36 pm »
I'm still getting the same problem.

3
Graphics / Re: Sprite getPosition function giving wrong y value.
« on: September 07, 2013, 04:44:03 pm »
EDIT: I thought I'd also add I'm using a view and the players position is set so that it's centered in the view.

Due to some of the things OpenGL does internally when you have a view set at a position that is not a whole number (float instead of integer) you will not get pixels to lineup exactly. The best solution is to round your view's position to a whole number.

Okay thank you very much, I'll give that a shot.

4
Graphics / Sprite getPosition function giving wrong y value.
« on: September 07, 2013, 04:27:17 pm »
So I have two sprites drawn.
The map and the player.
If I use getPosition on the map sprite and print it out it gives me 0, 0.
If I line up my player as close as I can to 0, 0.



Then print out the coords of the player as according to getPosition...
In that shot it tells me x is like -0.05, which looks correct, but as you can see the top of the player is BELOW the apparent 0 y point of the map, but I'm being told it's like -0.3, when as you can see it should be about 0.1 or whatever.

Is this a bug or am I doing something wrong or..I really have no idea and it caused great frustration as to why my collision function wasn't working.

EDIT: I thought I'd also add I'm using a view and the players position is set so that it's centered in the view.

Pages: [1]
anything