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 - Winski

Pages: [1]
1
Graphics / Re: Setting pixels per unit
« on: October 12, 2013, 10:00:36 pm »
@eXpl0it3r: That's what I am doing so far, I was just wondering if I can make it easier
@Nexus: That's why I thought of this :) - I wanted to use something more like view of size (8,6) instead of (800, 600), which means 10 tiles in x, 8 tiles in y instead of 800px in x, 600px in y - this can be done by view.scale(1/(pixelsPerUnit)); but I would need to apply the same scale to each sprite during creation, which would be very inconvenient for me.
Anyway, thanks you both for immediate help, problem is solved :)

2
Graphics / Setting pixels per unit
« on: October 12, 2013, 09:18:59 pm »
I've been searching for like 2 hours and I couldn't find the answer - maybe I didn't formulate the inquiry properly, so sorry in advance if the topic is doubled.
I am messing around with SFML and I wanted to improve my drawing loop. For now, when I want to draw some sprite/tile/whatever I need to use pixels as the position for them. What I would like to have is to set something like: pixelToUnitRatio(100); which would mean that when I create a sprite of size 100px*100px I receive it as an 1.0f*1.0f object (for now I would get 100.0f*100.0f). This would help me with creating bigger worlds - units are easier to read and each tile could have a size of 1.0f*1.0f. How to solve that?
Thanks in advance

Pages: [1]
anything