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

Author Topic: Making A Menu  (Read 1823 times)

0 Members and 1 Guest are viewing this topic.

BusinessSloth

  • Newbie
  • *
  • Posts: 5
    • View Profile
Making A Menu
« on: October 05, 2011, 03:55:04 am »
I'm new to SFML and I'm trying to make a menu screen. I have the pictures in it, I just need to know how make it control like this. I want the arrow on the left of the words to move down, skipping to each word on the menu whenever the down arrow key is pressed.

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Making A Menu
« Reply #1 on: October 05, 2011, 03:59:24 am »
Did you even try? Seems like you want us to write your code for you.

Try looping through the event stack and checking for key inputs of up and down, and then respond to those events accordingly.

BusinessSloth

  • Newbie
  • *
  • Posts: 5
    • View Profile
Making A Menu
« Reply #2 on: October 05, 2011, 04:14:00 am »
Yes I tried :P I know how to get key inputs, I just want to know how to make a sprite jump to a position.

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Making A Menu
« Reply #3 on: October 05, 2011, 04:16:28 am »
Code: [Select]
Sprite.SetPosition(x, y)

or if you have a fixed height that you want to move it

Code: [Select]
Sprite.Move(0, height)

BusinessSloth

  • Newbie
  • *
  • Posts: 5
    • View Profile
Making A Menu
« Reply #4 on: October 05, 2011, 04:25:51 am »
Oh well that was easy haha, thank you!