Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Drago - Custom Resolution
- # Version : 1.51
- # Contact : littledrago.blogspot.com / forum.chaos-project.com
- #==============================================================================
- ($imported ||= {})[:drg_custom_resolution] = 1.51
- #==============================================================================
- #
- # Introduction :
- #
- # I created this script based on the idea I get from F0's Custom Resolution.
- # There is no tilemap rewrite involved in this script.
- #
- # Issue :
- #
- # - Normal transition didn't work
- # - Fullscreen is disabled
- # - May cause glitch if using resolution lower than 640x480
- # - Custom menu system will require an edit to match the new resolution
- # - Anything that modify Sprite_Character & Spriteset_Map will require an edit
- #
- # Links :
- #
- # - Fantasist's Transitions Pack
- # http://forum.chaos-project.com/index.php/topic,1390.0.html
- # - ForeverZer0's Add-ons
- # http://forum.chaos-project.com/index.php/topic,7862.0.html
- # - ThallionDarkshine's Add-ons
- # http://forum.chaos-project.com/index.php/topic,12655.0.html
- # - Drago Transition Pack
- # http://forum.chaos-project.com/index.php/topic,13488.0.html
- #
- # - Adjust Menu Position
- # http://forum.chaos-project.com/index.php/topic,13781.0.html
- #
- # - ThallionDarkshine's F12 Fix
- # http://forum.chaos-project.com/index.php/topic,13629.0.html
- # - Zeriab's F12 Pause with images
- # http://forum.chaos-project.com/index.php/topic,3613.0.html
- #
- # Special Thanks :
- #
- # - ForeverZer0 for his original Custom Resolution
- # - KK20 for his update in F0's Custom Resolution v0.96
- #
- #==============================================================================
- module LiTTleDRAgo
- SCREEN_SIZE = [1024,580]
- # Define the resolution of the game screen. These values can be anything
- # within reason. Centering, viewports, etc. will all be taken care of, but it
- # is recommended that you use values divisible by 32 for best results.
- CONTROL_SCREEN_SIZE = true
- # If true, you can change the screen size with mouse
- end
- core = "This script needs Drago - Core Engine ver 1.58 or above"
- rmxp = "This script is RGSS1 only"
- ($imported[:drg_core_engine] || 0) >= 1.58 || raise(core)
- (LiTTleDRAgo::RGSS3 or LiTTleDRAgo::RGSS2) && raise(rmxp)
- #==============================================================================
- # ** Graphics
- #------------------------------------------------------------------------------
- # This module handles all Graphics
- #==============================================================================
- class << Graphics
- #-------------------------------------------------------------------------
- # * Alias Listing
- #-------------------------------------------------------------------------
- alias_sec_method :zer0_graphics_transition, :transition
- alias_sec_method :drg_resolution_change_resize_screen, :resize_screen
- alias_sec_method :drg_resolution_change_update, :update
- #-------------------------------------------------------------------------
- # * Aliased method: resize_screen
- #-------------------------------------------------------------------------
- def resize_screen(width, height)
- width = (width / 32.0).ceil * 32
- height = (height / 32.0).ceil * 32
- drg_resolution_change_resize_screen(width, height)
- refresh_scene
- end
- #-------------------------------------------------------------------------
- # * Aliased method: transition
- #-------------------------------------------------------------------------
- def transition(duration = 8, *args)
- if width <= 640 && height <= 480
- return zer0_graphics_transition(duration, *args)
- elsif duration > 0
- viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
- sprite = Sprite.new(viewport)
- sprite.bitmap = Graphics.snap_to_bitmap
- sprite2 = Sprite.new(viewport)
- sprite2.z = sprite.z - 10
- sprite2.blend_type = 1
- zer0_graphics_transition(0)
- fade = 255 / duration
- if (file = args.at(0)).is_a?(String)
- bitmap = Bitmap.new(file)
- sprite2.bitmap = bitmap.stretch(width,height)
- bitmap.dispose
- end
- duration.times { [sprite,sprite2].each {|s|s.opacity -= fade} && update }
- [sprite.bitmap, sprite2.bitmap, sprite, sprite2, viewport].dispose
- end
- zer0_graphics_transition(0)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: update
- #-------------------------------------------------------------------------
- def update
- drg_resolution_change_update
- if @_width != width || @_height != height
- @_width = width
- @_height = height
- resize_screen(@_width, @_height)
- end
- end
- #-------------------------------------------------------------------------
- # * Overwriten method: fullscreen
- #-------------------------------------------------------------------------
- def fullscreen
- @fullscreen = true
- Graphics.fill_monitor
- LiTTleDRAgo.hide_borders
- control_screen_size(false)
- refresh_scene
- end
- #-------------------------------------------------------------------------
- # * Overwriten method: window
- #-------------------------------------------------------------------------
- def window
- @fullscreen = false
- LiTTleDRAgo.show_borders
- control_screen_size(LiTTleDRAgo::CONTROL_SCREEN_SIZE)
- Graphics.resize_screen(*LiTTleDRAgo::SCREEN_SIZE)
- end
- #-------------------------------------------------------------------------
- # * Overwriten method: fullscreen?
- #-------------------------------------------------------------------------
- def fullscreen?
- @fullscreen == true
- end
- #-------------------------------------------------------------------------
- # * New method: refresh_scene
- #-------------------------------------------------------------------------
- def refresh_scene
- if $scene.is_a?(Scene_Map)
- $scene = $scene.class.new
- $game_player.center($game_player.x,$game_player.y)
- end
- end
- end
- Graphics.window
- Graphics.disable_alt_enter
- #==============================================================================
- # ** Game_Map
- #------------------------------------------------------------------------------
- # This class handles the map. It includes scrolling and passable determining
- # functions. Refer to "$game_map" for the instance of this class.
- #==============================================================================
- class Game_Map
- #-------------------------------------------------------------------------
- # * Alias Listing
- #-------------------------------------------------------------------------
- alias_sec_method(:drg_scroll_right_adjust, :scroll_right)
- alias_sec_method(:drg_scroll_down_adjust, :scroll_down)
- alias_sec_method(:drg_width_adjust, :width)
- alias_sec_method(:drg_height_adjust, :height)
- #-------------------------------------------------------------------------
- # * Aliased method: width / height
- #-------------------------------------------------------------------------
- define_method(:width) { @map ? drg_width_adjust : 0 }
- define_method(:height) { @map ? drg_height_adjust : 0 }
- #-------------------------------------------------------------------------
- # * Aliased method: scroll_right
- #-------------------------------------------------------------------------
- def scroll_right(distance)
- result = [@display_x + distance, map_edge_x].min
- drg_scroll_right_adjust(distance)
- @display_x = result
- end
- #-------------------------------------------------------------------------
- # * Aliased method: scroll_down
- #-------------------------------------------------------------------------
- def scroll_down(distance)
- result = [@display_y + distance, map_edge_y].min
- drg_scroll_down_adjust(distance)
- @display_y = result
- end
- #-------------------------------------------------------------------------
- # * New method: tile_size
- #-------------------------------------------------------------------------
- define_method(:tile_size_x) {(Graphics.width / 32.0).ceil}
- define_method(:tile_size_y) {(Graphics.height / 32.0).ceil}
- define_method(:map_edge_x) {[(width - tile_size_x) * 128, 0].max}
- define_method(:map_edge_y) {[(height - tile_size_y) * 128, 0].max}
- end
- #==============================================================================
- # ** Game_Player
- #------------------------------------------------------------------------------
- # This class handles the player. Its functions include event starting
- # determinants and map scrolling. Refer to "$game_player" for the one
- # instance of this class.
- #==============================================================================
- class Game_Player
- #-------------------------------------------------------------------------
- # * Alias Listing
- #-------------------------------------------------------------------------
- alias_sec_method(:drg_adjust_viewport_center, :center)
- #-------------------------------------------------------------------------
- # * Aliased method: center
- #-------------------------------------------------------------------------
- def center(x, y)
- drg_adjust_viewport_center(x, y)
- if $game_map.width < $game_map.tile_size_x
- Game_Player.const_set(:CENTER_X, $game_map.width * 128)
- else
- Game_Player.const_set(:CENTER_X, (($game_map.tile_size_x*32/2)-16)*4)
- end
- if $game_map.height < $game_map.tile_size_y
- Game_Player.const_set(:CENTER_Y, $game_map.height * 128)
- else
- Game_Player.const_set(:CENTER_Y, (($game_map.tile_size_y*32/2)-16)*4)
- end
- max_x = $game_map.map_edge_x
- max_y = $game_map.map_edge_y
- $game_map.display_x = [0, [(x * 32*4) - CENTER_X, max_x].min].max
- $game_map.display_y = [0, [(y * 32*4) - CENTER_Y, max_y].min].max
- end
- end
- #==============================================================================
- # ** Spriteset_Map
- #------------------------------------------------------------------------------
- # This class brings together map screen sprites, tilemaps, etc.
- # It's used within the Scene_Map class.
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_sec_reader :tilemap_ex, 'Array.new'
- attr_sec_reader :layer_sprite, 'Array.new'
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias_method(:initialize_tilemap_ex, :initialize)
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- if Graphics.width > 640 || Graphics.height > 480
- @sprite_black = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- @sprite_black.bitmap.full_fill(Color.black)
- end
- @tx_character_sprite = []
- if $game_map.width < $game_map.tile_size_x
- x = ($game_map.tile_size_x * 32 - $game_map.width * 32) / 2
- else
- x = 0
- end
- if $game_map.height < $game_map.tile_size_y
- y = ($game_map.tile_size_y * 32 - $game_map.height * 32) / 2
- else
- y = 0
- end
- w = [$game_map.width * 32, $game_map.tile_size_x * 32].min
- h = [$game_map.height * 32, $game_map.tile_size_y * 32].min
- @offsets = [x,y,w,h]
- initialize_tilemap_ex
- update_tilemap_ex(true)
- end
- #--------------------------------------------------------------------------
- # * New method : create_tilemap
- #--------------------------------------------------------------------------
- def refresh_tilemap
- @tilemap.priorities = $game_map.priorities
- data = $game_map.data.clone
- (0...data.zsize).each do |z|
- (0...data.ysize).each do |y|
- (0...data.xsize).each do |x|
- data[x,y,z] = 0 if @tilemap.priorities[data[x,y,z]] > 0
- end
- end
- end
- @tilemap.map_data = data
- end
- #--------------------------------------------------------------------------
- # * New method : create_data_layer
- #--------------------------------------------------------------------------
- def create_data_layer(data, priorities, layer = true)
- content = []
- (0...data.zsize).each do |z|
- (0...data.ysize).each do |y|
- skip = []
- (0...data.xsize).each do |x|
- next if skip.include?(x)
- next if (_data = data[x,y,z]) < 384
- next if layer && priorities[_data] == 0
- next if !layer && priorities[_data] > 0
- hash = {}
- hash[:pos] = [[(_x = x),y,z]]
- hash[:data] = [_data]
- hash[:priorities] = priorities[_data]
- while (_x + 1) < data.xsize &&
- (_data2 = data[_x+1,y,z]) != 0 &&
- priorities[_data] == priorities[_data2]
- skip.push(_x = _x + 1)
- hash[:pos].push([_x,y,z])
- hash[:data].push(data[_x,y,z])
- end
- content.push(hash)
- end
- end
- end
- content
- end
- #--------------------------------------------------------------------------
- # * New method : refresh_tilemap_ex
- #--------------------------------------------------------------------------
- def refresh_tilemap_ex
- tilemap_ex.dispose
- tilemap_ex.clear
- _ex = @offsets[2] <= 640 ? 1 : (Graphics.width / 640.0).ceil
- _ey = @offsets[3] <= 480 ? 1 : (Graphics.height/ 480.0).ceil
- @data_layer = create_data_layer($game_map.data, $game_map.priorities)
- refresh_tilemap
- refresh_layer
- viewport = @viewport1,@viewport2,@viewport3
- viewport.resize(*@offsets)
- _ex.times do |x|
- _ey.times do |y|
- next if x + y == 0
- ex, ey = x * 640, y * 480
- viewport = Viewport.new(ex,ey,640,480)
- viewport.z = @tilemap.viewport.z - 1
- viewport.resize(ex + @offsets[0], ey + @offsets[1],
- (Graphics.width - ex) - (@offsets[0] * 2) + 8,
- (Graphics.height - ey) - (@offsets[1] * 2) + 8)
- @tilemap.viewport.children.push(viewport)
- tilemap_ex[(s = tilemap_ex.size)] = @tilemap.class.new(viewport)
- tilemap_ex[s].tileset = @tilemap.tileset
- 7.times { |i| tilemap_ex[s].autotiles[i] = @tilemap.autotiles[i] }
- tilemap_ex[s].map_data = @tilemap.map_data
- tilemap_ex[s].priorities = @tilemap.priorities
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh_layer
- return unless @data_layer
- layer_sprite.dispose
- layer_sprite.clear
- @data_layer.each do |layer|
- sprite = RPG::Sprite.new(@viewport1)
- sprite.instance_variable_set(:@data_layer,layer)
- if LiTTleDRAgo.cache.include?(layer[:data])
- bitmap = LiTTleDRAgo.cache.get_cache(layer[:data])
- else
- bitmap = Bitmap.new(32*layer[:data].size,32)
- layer[:data].each_with_index do |tile_id,index|
- x = (tile_id - 384) % 8 * 32
- y = (tile_id - 384) / 8 * 32
- rect = Rect.new(x, y, 32, 32)
- bitmap.blt(32*index, 0, @tilemap.tileset, rect)
- end
- LiTTleDRAgo.cache.add_cache(layer[:data],bitmap)
- end
- sprite.bitmap = bitmap
- layer_sprite.push(sprite)
- end
- update_layer
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- define_post_alias(:update) do
- if (sb = @sprite_black) && sb.not.disposed?
- sb.opacity > 0 ? (sb.opacity -= 10) : sb.dispose
- end
- update_tilemap_ex
- end
- #--------------------------------------------------------------------------
- # * New method : update_tilemap_ex
- #--------------------------------------------------------------------------
- def update_tilemap_ex(refresh = false)
- refresh_tilemap_ex if refresh
- tilemap_ex.each do |ex|
- ex.ox = @tilemap.ox + ex.viewport.x - @viewport1.x
- ex.oy = @tilemap.oy + ex.viewport.y - @viewport1.y
- end
- tilemap_ex.update
- update_layer
- end
- #--------------------------------------------------------------------------
- # * Overwritten method : update_viewport_size_change
- #--------------------------------------------------------------------------
- def update_viewport_size_change() end
- #--------------------------------------------------------------------------
- # * Overwritten method : update_layer
- #--------------------------------------------------------------------------
- def update_layer
- layer_sprite.each do |sprite|
- return refresh_layer if sprite.nil?
- data_layer = sprite.instance_variable_get(:@data_layer)
- sprite.x = (data_layer[:pos][0][0] * 32) - $game_map.display_x / 4
- sprite.y = (data_layer[:pos][0][1] * 32) - $game_map.display_y / 4
- case (z = data_layer[:priorities])
- when -1
- sprite.z = 0
- else
- sprite.z = sprite.y + 16 + 32 * (z + 1)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- define_post_alias(:dispose) do
- tilemap_ex.dispose
- layer_sprite.dispose
- @sprite_black.dispose if @sprite_black && !@sprite_black.disposed?
- end
- end
- #==============================================================================
- # ** Viewport
- #------------------------------------------------------------------------------
- #
- #==============================================================================
- class Viewport
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_sec_reader :children, 'Array.new'
- attr_sec_accessor :offset_x, :offset_y, 0
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias_sec_method(:flash_resolution, :flash)
- alias_sec_method(:set_trigger_vp_ox, :"ox=")
- alias_sec_method(:set_trigger_vp_oy, :"oy=")
- alias_sec_method(:tone_resolution, :tone=)
- #--------------------------------------------------------------------------
- # * Frame Update, Frame Dispose
- #--------------------------------------------------------------------------
- define_post_alias(:update) { children.update }
- define_post_alias(:dispose) { children.dispose }
- define_sec_method(:parent?) { children.not.empty? }
- #-------------------------------------------------------------------------
- # * New method: resize
- #-------------------------------------------------------------------------
- def resize(*args)
- # Resize the viewport. Can call with (X, Y, WIDTH, HEIGHT) or (RECT).
- if args[0].is_a?(Rect)
- args[0].x += offset_x
- args[0].y += offset_y
- self.rect = args[0]
- else
- args[0] += offset_x
- args[1] += offset_y
- self.rect = Rect.new(*args)
- end
- end
- #-------------------------------------------------------------------------
- # * Aliased method: resize
- #-------------------------------------------------------------------------
- alias_method(:resize_trigger, :resize)
- def resize(*args)
- children.each do |child|
- if args[0].is_a?(Rect)
- rect = args[0]
- new_args = Rect.new(rect.x,rect.y,child.rect.width,child.rect.height)
- else
- new_args = [args[0],args[1]]
- new_args[2] = child.rect.width
- new_args[3] = child.rect.height
- end
- child.resize_trigger(*new_args)
- end
- resize_trigger(*args)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: flash
- #-------------------------------------------------------------------------
- def flash(color, duration)
- send(:flash_resolution, color, duration)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: ox=
- #-------------------------------------------------------------------------
- def ox=(nx)
- return if self.ox == nx
- ([self] + children).each {|child| child.set_trigger_vp_ox(nx)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: oy=
- #-------------------------------------------------------------------------
- def oy=(ny)
- return if self.oy == ny
- ([self] + children).each {|child| child.set_trigger_vp_oy(ny)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: tone=
- #-------------------------------------------------------------------------
- def tone=(t)
- send(:tone_resolution,t)
- end
- end
- #==============================================================================
- # ** Plane
- #------------------------------------------------------------------------------
- #
- #==============================================================================
- class Plane
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_sec_reader :children, 'Array.new'
- attr_sec_accessor :offset_x, :offset_y, 0
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias_method(:resolution_initialize, :initialize)
- alias_sec_method(:zoom_x_resolution, :'zoom_x=')
- alias_sec_method(:zoom_y_resolution, :'zoom_y=')
- alias_sec_method(:ox_resolution, :'ox=')
- alias_sec_method(:oy_resolution, :'oy=')
- alias_sec_method(:bitmap_resolution, :'bitmap=')
- alias_sec_method(:setvisible_resolution, :'visible=')
- alias_sec_method(:getvisible_resolution, :'visible')
- alias_sec_method(:z_resolution, :'z=')
- alias_sec_method(:opacity_resolution, :'opacity=')
- alias_sec_method(:color_resolution, :'color=')
- alias_sec_method(:blend_type_resolution, :'blend_type=')
- alias_sec_method(:tone_resolution, :'tone=')
- #--------------------------------------------------------------------------
- # * Frame Dispose
- #--------------------------------------------------------------------------
- define_post_alias(:dispose) { children.dispose }
- define_sec_method(:parent?) { children.not.empty? }
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(viewport=nil,parent=true)
- @parent = parent
- resolution_initialize(viewport)
- # If the parent Plane object; but don't make more children if already have
- # some. This occurs in Spriteset_Map when initializing the Panorama and Fog
- if @parent && self.viewport
- create_children
- end
- end
- #-------------------------------------------------------------------------
- # * Aliased method: create_children
- #-------------------------------------------------------------------------
- def create_children
- if $scene.is_a?(Scene_Map)
- gw = [Graphics.width, $game_map.width * 32].min
- gh = [Graphics.height, $game_map.height * 32].min
- else
- gw, gh = Graphics.width, Graphics.height
- end
- w = (gw - 1) / 640
- h = (gh - 1) / 480
- for y in 0..h
- for x in 0..w
- # This is the top-left default/parent Plane, so skip it
- # next if x + y == 0
- # Create viewport unless it already exists
- width = w > 0 && x == w ? gw - 640 : 640
- height = h > 0 && y == h ? gh - 480 : 480
- vp = Viewport.new(x * 640,y * 480,width,height)
- vp.offset_x = x * 640
- vp.offset_y = y * 480
- self.viewport.children.push(vp)
- # Have to do this in order to prevent overlapping with the parent
- # (for Spriteset_Map viewport1 mainly)
- vp.z = self.viewport.z
- self.viewport.children.push(vp)
- # Create the child Plane
- plane = Plane.new(vp,false)
- plane.offset_x = x * 640
- plane.offset_y = y * 480
- plane.ox = 0
- plane.oy = 0
- # Push to array
- children.push(plane)
- end
- end
- setvisible_resolution(false) if parent?
- end
- # For the remaining properties, if the parent changes, so do its children
- #-------------------------------------------------------------------------
- # * Aliased method: zoom_x=
- #-------------------------------------------------------------------------
- def zoom_x=(new_val)
- ([self] + children).each {|child| child.zoom_x_resolution(new_val)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: zoom_y=
- #-------------------------------------------------------------------------
- def zoom_y=(new_val)
- ([self] + children).each {|child| child.zoom_y_resolution(new_val)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: ox=
- #-------------------------------------------------------------------------
- def ox=(new_val)
- children.each {|child| child.ox = new_val}
- ox_resolution(new_val + offset_x)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: oy=
- #-------------------------------------------------------------------------
- def oy=(new_val)
- children.each{|child| child.oy = new_val}
- oy_resolution(new_val + offset_y)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: bitmap=
- #-------------------------------------------------------------------------
- def bitmap=(new_val)
- ([self] + children).each {|child| child.bitmap_resolution(new_val)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: visible=
- #-------------------------------------------------------------------------
- def visible=(new_val)
- if parent?
- children.send(:setvisible_resolution,new_val)
- setvisible_resolution(false)
- else
- setvisible_resolution(new_val)
- end
- end
- #-------------------------------------------------------------------------
- # * Aliased method: visible
- #-------------------------------------------------------------------------
- def visible
- (parent? ? children.at(0) : self).getvisible_resolution
- end
- #-------------------------------------------------------------------------
- # * Aliased method: z=
- #-------------------------------------------------------------------------
- def z=(new_val)
- # Because the children spawn new Viewports, they have to be lower than the
- # parent's viewport to prevent drawing OVER the parent...unless the Plane's
- # z-value is more than zero, in which case the children viewports NEED to be
- # higher than the parent's. By doing this, we can have panoramas be below
- # the tilemap and fogs be over the tilemap.
- unless children.empty?
- child = @children[0]
- if new_val > 0 && child.viewport.z < self.viewport.z
- @children.each{|child| child.viewport.z += 1}
- elsif new_val <= 0 && child.viewport.z >= self.viewport.z
- @children.each{|child| child.viewport.z -= 1}
- end
- children.each{|child| child.z_resolution(new_val)}
- end
- z_resolution(new_val)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: opacity=
- #-------------------------------------------------------------------------
- def opacity=(new_val)
- ([self] + children).each {|child| child.opacity_resolution(new_val)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: color=
- #-------------------------------------------------------------------------
- def color=(new_val)
- (parent? ? children : self).send(:color_resolution,new_val)
- end
- #-------------------------------------------------------------------------
- # * Aliased method: blend_type=
- #-------------------------------------------------------------------------
- def blend_type=(new_val)
- ([self] + children).each {|child| child.blend_type_resolution(new_val)}
- end
- #-------------------------------------------------------------------------
- # * Aliased method: tone=
- #-------------------------------------------------------------------------
- def tone=(new_val)
- (parent? ? children : self).send(:tone_resolution,new_val)
- end
- end
- #==============================================================================
- # ** RPG::Cache
- #==============================================================================
- ModCache = LiTTleDRAgo.cache
- class << ModCache
- #--------------------------------------------------------------------------
- # * New method: include?
- #--------------------------------------------------------------------------
- unless method_defined?(:include?)
- def include?(key)
- @cache[key] && !@cache[key].disposed?
- end
- end
- def add_cache(key,bitmap)
- @cache[key].dispose if include?(key)
- @cache[key] = bitmap
- end
- def get_cache(key)
- @cache[key] if include?(key)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement