Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Cursor left/right movement
« previous next »
  • Print
Pages: [1]

Author Topic: Cursor left/right movement  (Read 1922 times)

Offline DarkGoten

  • Gfx master
  • Initiate
  • *
  • Posts: 15
Cursor left/right movement
« on: July 04, 2006, 06:29:06 AM »
It's been awhile since I used rm2k3 and I can't find a tutorial that shows you how to make your cursor move left/right, if anyone can show me I would highly appreciate it and thanks^.^
Logged

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #1 on: July 04, 2006, 12:05:15 PM »
Well, if you're making a map-based menu system, you could just make the hero into the cursor. Picture-based cursors are a bit more difficult, but still doable, but I don't really want to explain how to do it unless I have to. I'm lazy like that. :p
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

Offline Tomi

  • *does mannerism*
  • Leader
  • *
  • Posts: 2,000
(No subject)
« Reply #2 on: July 04, 2006, 12:28:08 PM »
Thank you Mr. Mod :p

I too am too lazy.  Figure it out with logic.
Logged

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #3 on: July 04, 2006, 03:22:16 PM »
You know, Tomi, I could delete that post and claim that it was spam. ;)

For a picture-based cursor, you'll first need to do a bit of setup. Create two variables, one called Input and one called CursorPos. Set the CursorPos variable to 1, and create a Show Picture command that shows a cursor picture at a certain point.

Next, create a Key Input/Password command, with the "Store in Variable" set to the Input var. Uncheck the "Wait Until Key Pressed" button, and select only the Left and Right buttons.

Next, create a Conditional Branch/Fork that checks if the Input variable is 3. If it is, that means that the player has pressed the Right button. Create another Fork/Branch that checks if the CursorPos var is 1; if it is, move the cursor right a certain amount (to the next option), and add 1 to CursorPos via a Variable Operation. In the Else Handler of that branch, create another branch that checks if CursorPos is 2. If it is, move it tot he next option, and add 1 to CursorPos. Keep doing that until you reach the last option; in that case, you'll want to move the cursor to the first option, and set CursorPos to 1.

Now, go back up to the first Branch "If Var[Input] is 3". In that branch's Else Handler, create another branch that checks if Input is 2. This will check for the Left button being pressed.
Basically, all you have to do is copy the Right sequence and paste it in the Left branch, but change a few things around - instead of moving forward one option when the button is pressed, you move it back. So if CursorPos is 3, and Left is pressed, it moves the cursor to the second option, and subtracts 1 from CursorPos, and if CursorPos is 1, it sets the cursor position to the last option and sets the variable to the number equal to the amounts of options.

Selecting choices is easy - you just check what the CursorPos var is. For example, if the first option is Save, then you create a branch that checks if CursorPos is 1. If it is, open the save menu. To do this, you'll have to set the Decision key as a choice in your Key Input/Password, and create a branch in the "Var[Input] is 2" Else handler.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Cursor left/right movement
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum