(RMVXA) Moving Window_Command

Started by BanisherOfEden, March 12, 2013, 06:25:07 pm

Previous topic - Next topic

BanisherOfEden

Hello. I don't know how to script, but I know how to use basic logic. >_>

I wanted to change the default menu script. I wanted to swap the commands and status.
I started with change
gold_window.x = 0

to
gold_window.x = 384


I then moved on to the status_window. I saw that it didn't have the x/y thing, so I just added it.
    @status_window.x = 0
    @status_window.y = 0


Now I'm at the window_command... I don't know what to do here.  :(

I've tried a few things... including~
@Window_MenuCommand.x = 384
@Window_MenuCommand.y = 99


@Window_Command.x = 384
@Window_Command.y = 99


and

@Command_Window.x = 384
@Command_Window.y = 99


I just can't figure out how to make it move. ~_~
Max characters: 2000; characters remaining: 1952

Blizzard

I'm not too fond of the scripting system in VXA, but if it follows a model that most do, then there should be an "update" method somewhere in that scene. The update method is called every frame so it gets executed repeatedly. If you added something like "@Command_Window.x += 1" there, it would move by 1 to the right every frame. You could then add some additional stopping condition and you could have something like:

if @Command_Window.x < 500
  @Command_Window.x += 4
end
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

BanisherOfEden


Thank you.
I am now one step closer to world domination completing my project.
Max characters: 2000; characters remaining: 1952

Blizzard

So am I. To completing my project of course, not world domination. I would never try to dominate the world. Ever. *realizes that everybody knows he has no project*
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

bigace

This should also work as well.

class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias ace_scene_menu_start_ame start
  def start
    ace_scene_menu_start_ame
    relocate_windows
  end
  #--------------------------------------------------------------------------
  # new method: relocate_windows
  #--------------------------------------------------------------------------
  def relocate_windows
    @command_window.x = Graphics.width - @command_window.width
    @gold_window.x = Graphics.width - @gold_window.width
    @status_window.x = 0
  end
end


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.