The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: blazinhandle on March 16, 2008, 01:59:25 PM

Title: Working with Planes
Post by: blazinhandle on March 16, 2008, 01:59:25 PM
Does anybody know how to turn the visibility off?

I've tried
@plane.visible = false
but it obviously isn't the way to do it. Anyone know how would you turn it off if you've called it within a window?
Title: Re: Working with Planes
Post by: Falcon on March 16, 2008, 02:34:14 PM
Strike 1, this should be in script help.

Try @plane.opacity = 0
Title: Re: Working with Planes
Post by: modern algebra on March 16, 2008, 03:37:55 PM
Hmm, I don't even know what a plane is :P

Quote from: Help
The Plane class. Planes are special sprites that tile bitmap patterns across the entire screen, and are used to display panoramas and fog.

SuperclassObject
Class MethodPlane.new([viewport])
Creates a Plane object. Specifies a Viewport (Viewport) when necessary.

Methods

dispose
Frees the plane. If the plane has already been freed, does nothing.

disposed?
Returns TRUE if the plane has been freed.

viewport
Retrieves the Viewport (Viewport) specified when the plane was created.

Propertiesbitmap
Refers to the bitmap (Bitmap) used in the plane.

visible
Whether the plane can be seen. If TRUE, the plane is visible.

z
The plane's Z-coordinate. The larger this value, the closer to the player the plane will be displayed. If multiple objects share the same Z-coordinate, the more recently created object will be displayed closest to the player.

ox
The X-coordinate of the plane's starting point. Change this value to scroll the plane.

oy
The Y-coordinate of the plane's starting point. Change this value to scroll the plane.

zoom_x
The plane's X-axis zoom level. 1.0 denotes actual pixel size.

zoom_y
The plane's Y-axis zoom level. 1.0 denotes actual pixel size.

opacity
The plane's opacity (0-255). Values out of range are automatically corrected.

blend_type
The plane's blending mode (0: normal, 1: addition, 2: subtraction).

color
The color (Color) to be blended with the plane. Alpha values are used in the blending ratio.

tone
The plane's color tone (Tone).



According to that, planes do have a visible property.

Hmm, it's really quite strange.

I went into Spriteset Map to test it out and I put it here:


def update
    # If panorama is different from current one
    if @panorama_name != $game_map.panorama_name or
       @panorama_hue != $game_map.panorama_hue
      @panorama_name = $game_map.panorama_name
      @panorama_hue = $game_map.panorama_hue
      if @panorama.bitmap != nil
        @panorama.bitmap.dispose
        @panorama.bitmap = nil
      end
      if @panorama_name != ""
        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
      end
      Graphics.frame_reset
    end
    # If fog is different than current fog
    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
      @fog_name = $game_map.fog_name
      @fog_hue = $game_map.fog_hue
      if @fog.bitmap != nil
        @fog.bitmap.dispose
        @fog.bitmap = nil
      end
      if @fog_name != ""
        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
      end
      p @fog.visible
      @fog.visible = false
      p @fog.visible
      Graphics.frame_reset
    end


Though the print statement said true, the fog was no longer shown.