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

Author Topic: FlipX and FlipY for sfml strings  (Read 6834 times)

0 Members and 1 Guest are viewing this topic.

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
FlipX and FlipY for sfml strings
« on: November 14, 2008, 03:31:06 pm »
Hi...

for sprites FlipX and FlipY allow to flip them, but for
strings these functions are missing. Unfortunately I
need them. Is there an easy way to get what I need?

Thanks for your help - Sven

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
FlipX and FlipY for sfml strings
« Reply #1 on: November 15, 2008, 02:33:39 am »
You can rotate the string to simulate flipping it.

I'm not sure why SFML doesn't allow flipping of sf::String.

In my opinion, you should be allowed to flip sf::Shape too, although that would be complicated to add.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FlipX and FlipY for sfml strings
« Reply #2 on: November 15, 2008, 11:32:42 am »
In what situation would you need to display flipped text ? :D
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
FlipX and FlipY for sfml strings
« Reply #3 on: November 15, 2008, 12:44:30 pm »
Quote from: "Laurent"
In what situation would you need to display flipped text ? :D


I'm not a game programmer but I want to use sfml for programming cognitive psychology experiments. For one line of research rotated single characters are displayed 'normal' or as mirror images and subjects were to decide as fast as possible whether the characters are normal or mirror images. Thus, I need to flip the characters to produce mirror images.

Yours - Sven

dorkfish

  • Newbie
  • *
  • Posts: 38
    • View Profile
FlipX and FlipY for sfml strings
« Reply #4 on: November 15, 2008, 12:45:13 pm »
Quote from: "Laurent"
In what situation would you need to display flipped text ? :D


Well, you could use it for mirrored text effects, and shadows. Actually, I'm not sure if classes support them, but FlipX and FlipY would probably be useful for all drawable objects. Skewing would also be pretty neat. I'd find a lot of use in both sets of methods when I get around to writing a sprite and tile editor for my game, and also some in-game effects.  :)

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
FlipX and FlipY for sfml strings
« Reply #5 on: November 15, 2008, 04:30:38 pm »
Yes, text effects would certainly be nice. I thought about this to, if you are able to do a flipY(), then you can easily do web2.0 fluff ground text reflections.

wizardofoz

  • Newbie
  • *
  • Posts: 18
    • View Profile
FlipX and FlipY for sfml strings
« Reply #6 on: November 16, 2008, 09:39:10 am »
When render to texture will be avaiable you could render text to a texture and display it flipped or rotated.

bullno1

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
FlipX and FlipY for sfml strings
« Reply #7 on: November 16, 2008, 12:15:25 pm »
Can a negative scale do the trick?

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
FlipX and FlipY for sfml strings
« Reply #8 on: November 16, 2008, 12:33:15 pm »
Quote from: "bullno1"
Can a negative scale do the trick?


Documentation says for SetScaleX() values must be strictly positive and I tried a negative value: no effect.

-Sven-

wizardofoz

  • Newbie
  • *
  • Posts: 18
    • View Profile
FlipX and FlipY for sfml strings
« Reply #9 on: November 16, 2008, 03:03:37 pm »

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
FlipX and FlipY for sfml strings
« Reply #10 on: November 16, 2008, 09:06:39 pm »
Would you be so kind as to post your code. Thanx.

-Sven-

wizardofoz

  • Newbie
  • *
  • Posts: 18
    • View Profile
FlipX and FlipY for sfml strings
« Reply #11 on: November 17, 2008, 03:06:02 pm »
Quote
Would you be so kind as to post your code. Thanx.


The image I have posted refers to a my add-on code that is not part of the official SFML library.
Please refer to http://www.sfml-dev.org/forum/viewtopic.php?t=740 post for more informations.