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

Author Topic: Text Effects  (Read 4391 times)

0 Members and 1 Guest are viewing this topic.

0026sd

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Text Effects
« on: June 06, 2013, 06:08:03 pm »
Hey everyone!!

Just a general question of which I cannot adequately find an answer for within the forum (or on Google).

I'm creating a menu with menu entries and I want to add a text effect to the menu entry when it's hovered over. This can be anything like a glow, outline, what-have-you. I feel like it would be so much less overhead than creating 2 images of every menu entry I have if I could check if the mouse was colliding with the entry and, if so, call a hover() on it or something.

SO! My question is, is this possible through SFML? I looked through parts of the Graphics module in the documentation but didn't see what I was looking for... perhaps I was looking in the wrong place.

Any tips/advice would be very much appreciated.

Thanks,
Scott.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Text Effects
« Reply #1 on: June 06, 2013, 07:20:37 pm »
Hey everyone!!

Just a general question of which I cannot adequately find an answer for within the forum (or on Google).

I'm creating a menu with menu entries and I want to add a text effect to the menu entry when it's hovered over. This can be anything like a glow, outline, what-have-you. I feel like it would be so much less overhead than creating 2 images of every menu entry I have if I could check if the mouse was colliding with the entry and, if so, call a hover() on it or something.

SO! My question is, is this possible through SFML? I looked through parts of the Graphics module in the documentation but didn't see what I was looking for... perhaps I was looking in the wrong place.

Any tips/advice would be very much appreciated.

Thanks,
Scott.

SFML does not provide any way to do this directly. SFML provides building blocks that you can use to implement effects like this. One way to do this would be through a shader, another way as you guessed would be to create multiple textures of your buttons.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

0026sd

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Text Effects
« Reply #2 on: June 06, 2013, 07:54:46 pm »
Hey everyone!!

Just a general question of which I cannot adequately find an answer for within the forum (or on Google).

I'm creating a menu with menu entries and I want to add a text effect to the menu entry when it's hovered over. This can be anything like a glow, outline, what-have-you. I feel like it would be so much less overhead than creating 2 images of every menu entry I have if I could check if the mouse was colliding with the entry and, if so, call a hover() on it or something.

SO! My question is, is this possible through SFML? I looked through parts of the Graphics module in the documentation but didn't see what I was looking for... perhaps I was looking in the wrong place.

Any tips/advice would be very much appreciated.

Thanks,
Scott.

SFML does not provide any way to do this directly. SFML provides building blocks that you can use to implement effects like this. One way to do this would be through a shader, another way as you guessed would be to create multiple textures of your buttons.

Ah, yes I read briefly about shaders and wondered if that was a viable option. Thanks for your advice!