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

Pages: [1]
1
Graphics / Re: easiest way to repeat a texture to fill a rectangle
« on: May 05, 2013, 10:59:32 pm »
the texture is set to repeat, and the area is huge compared to the texture. but it only stretches a single copy of the texture to fill the the rectangle.

edit: derp, didnt notice the need for textureRect as apposed to rectangleShape. ill check it out

edit: k figured it out. didn't know you had to set a sprite's textureRect to be the size of the rectangle i wanted to fill. thanks for the help!

2
Graphics / easiest way to repeat a texture to fill a rectangle
« on: May 05, 2013, 04:41:59 am »
i'm trying to use a texture as a background, but when i use a sprite set with a texture that is set to repeat, it only shows the texture one time and it doesn't repeat. am i not using this function correctly?

i also tried applying the texture to a rectangle shape, but it just stretches the texture to fill the box one time.

any tips would be appreciated!

3
Graphics / Re: best implementation of word wrapping in a container?
« on: April 30, 2013, 10:21:40 pm »
VICTORY! haha i figured it out!

once i complete my function, i can post a code snippet of how i implemented it.

thanks again nexus and laurent!

special thanks to laurent for developing this kick ass library!

4
Graphics / Re: best implementation of word wrapping in a container?
« on: April 30, 2013, 09:17:27 am »
so i messed around with a function to tally the sizes of the glyphs that create my string to find how many glyphs fit in a line, and i noticed a few things.

for one, there is no glyph width for spaces. this throws off the calculation of the line width. is there any quick way to calculate this?

also, does the glyph not include whitespace between characters? this may affect the line calculation as well.

lastly, what number does the iterator start at to access the string contents via string.operator[]? i started at 0, and it seems to not count the first letter.

if anyone has any answers i would appreciate it!

edit: thank you nexus, i will check their implementation in the morning.

5
Graphics / Re: best implementation of word wrapping in a container?
« on: April 30, 2013, 01:01:27 am »
ah okay.

so what's the best way to go about this? iterate through the string (should i use the standard library string or sf::string?), keep a running tally of the total size, and if it goes over the width that i want, iterate back to the last space and insert a new line?

6
Graphics / best implementation of word wrapping in a container?
« on: April 29, 2013, 05:54:20 pm »
i've looked now for hours to find a simple implementation of text wrapping to a new line if the text is too long to fill a specific width (namely the width of the window).  i found this thread (http://en.sfml-dev.org/forums/index.php?topic=1939.0), but the project has been abandoned, and the source files are unobtainable.

does anyone have any thoughts on creating a system for either automatically parsing strings to include newline characters, or separate the original strings into new, smaller strings? it seems very silly to have to apply a string to a text element just to find it's width, only to deconstruct the string again.

any suggestions would be helpful!

Pages: [1]
anything