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] Accessing windows from other methods

Status
Not open for further replies.
I'm trying to do a method, that uses the mouse_over part of a mouse script to check if the mouse is over a window. But the window is in Scene_Map, and the test is in Sprite_Mouse.

So I've got:

unless mouse_over?(Scene_Map.rInput_window)

I added the mouse_over? method to Sprite_Mouse.

@rInput_window is a window in Scene_Map.

I know the error is probably in the Scene_Map.rInput_window, as I'm guessing the syntax here. What should I have put?
 

khmp

Sponsor

You can write an accessor in Scene_Map

Code:
attr_accessor :rInput_Window

Then in the sprite mouse input method you would have to do a specialized check that says if the $scene.is_a(Scene_Map) test input in rInput_Window.
 

arev

Sponsor

This topic has been resolved. If Wyatt or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
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