Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Geust on July 08, 2010, 02:00:45 am

Title: Delete
Post by: Geust on July 08, 2010, 02:00:45 am
Thanks.
Title: Re: Sliding windows
Post by: SBR* on July 08, 2010, 02:28:26 pm
You mean in your own script? It's really easy:
@window.x
or
@window.y
are the x and y coordinates if your windows. Simply add or substract from them. Do this in a loop do, or check for a class variable (it's true when moving, false when not moving) in the update method, and if it's true, let it move. Please remember to dispose your windows when they're out of the screen.
Title: Re: Sliding windows
Post by: SBR* on July 08, 2010, 03:58:20 pm
I haven't tested this, but it should work.
code: ShowHide
class Scene_Test
  def initialize(index = 0, return_to = Scene_Map)
    @index = index
    @return_to = return_to
  end
 
  def main
    @window = Window_Command.new(250, ['Quit'])
    @window.x = -@window.width
    Graphics.transition
    #Set window
    loop do
      @window.x += 3
      Graphics.update
      break if @window.x >= 0
    end
    @window.x = 0 #Fix position
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    @window.dispose
  end

  def update
    if @window.active
      @window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = return_to.new
      end
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        case @window.index
        when 0
          $scene = nil
        end
      end
    end
  end
end
Title: Re: Sliding windows
Post by: SBR* on July 08, 2010, 04:09:50 pm
Yeah, IK. I typed it in Opera really quickly...

EDIT: Lol. So many mistakes. I'm fixing them now.

EDIT: Fixed.
Title: Re: Sliding windows
Post by: stripe103 on July 08, 2010, 05:39:47 pm
the graphics slider by Kread-Ex is great foe this thing.
www.rpgrevolution.com/forums/index.php?showtopic=41667&hl=graphics+slider
Title: Re: Sliding windows
Post by: ForeverZer0 on July 08, 2010, 09:28:52 pm
Fantasist made a good script for this that was easy to implement into any scene. It's called "Moving Windows" or something like that.
Title: Re: Sliding windows
Post by: WhiteRose on July 08, 2010, 09:47:18 pm
Quote from: ForeverZero on July 08, 2010, 09:28:52 pm
Fantasist made a good script for this that was easy to implement into any scene. It's called "Moving Windows" or something like that.

I agree with your suggestion. Here's a link to the topic:
http://forum.chaos-project.com/index.php?topic=83.0
(Now you have no excuse to be lazy and not use it. ;))
Title: Re: Sliding windows
Post by: SBR* on July 10, 2010, 04:12:16 am
@window.moving?
to check if moving.

So your new result for the update method, where everything is only updated if not moving, will be:

def update
 @window.update
 if !@window.moving?
   #Update
 end
end


This is because the moving is included in the update method. Unless something else is included in the update method, like in Window_Command, you should use this. But if you manually added something in your own window's update method or used Window_Command, this is your new code:

def update
 if @window.moving?
   @window.move_wins
 else
   #Update
 end
end


EDIT: Duh. Nvm.
loop do
  @window.move_wins
end
Title: Re: Sliding windows
Post by: SBR* on July 10, 2010, 02:54:16 pm
Oh yeah, duh *slaps himself*.

loop do
 @window.move_wins
  Graphics.update
end


EDIT: I hate myself! Fixed!
Title: Re: Sliding windows
Post by: SBR* on July 11, 2010, 04:27:28 am
@actor_command_window.move(@actor_index*160, 480)
loop do
  @actor_command_window.move_wins
  Graphics.update
  break if !@actor_command_window.moving?
end

@actor_command_window.move(640, 480)
loop do
  @actor_command_window.move_wins
  Graphics.update
  break if !@actor_command_window.moving?
end

etc.