Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Window_Selectable Item Name to Variable

Status
Not open for further replies.
I guess it's kind of an indescriptive title, but I couldn't think of a better one... well, what I want to do is save the name of the item of a window to a variable. It should be something like this:
Code:
variable = @window.commands[index]
Well, that'd be for a Window_Command, I guess...

As a side note, it's a window with varying content (maybe that's why it's a Window_Selectable ^_^), just because it was mentioned in IRC...
 
Window_Slectable classes, like Window_Item and Window_Skill, have an instance method to get the @data at the current index. It's usually <instance>.item or <instance>.skill.
You can make the method like so:
Code:
class Your_Menu < Window_Selectable
  def item
    return @data[self.index]
  end
end
 
I see the method inside Window_Item, but how can I call @data in the respective scene? ^_^ (ah, I know the first post was miserable, please excuse my lack of concentration... ~.~)

EDIT: Nevermind, found it out... I must be very unconcentrated today ~.~ Thanks anyway, Yeyinde ^_^
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top