Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Cutscene Screen
- # Version : 0.x
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- # -----------------------------------------------------------------------------
- # Requires :
- # >> Theo - Core Movement (Basic Modules)
- # >> Theo - Core Fade (Basic Modules)
- # =============================================================================
- ($imported ||= {})[:Theo_Cutscreen] = true
- # =============================================================================
- # Change Logs:
- # -----------------------------------------------------------------------------
- # -
- # =============================================================================
- =begin
- Perkenalan :
- Script ini ngebuat screen RM kamu dipotong atas bawah sehingga tampak seperti
- film.
- Cara penggunaan :
- Pasang script ini di bawah material namun di atas main
- Gunakan script call seperti berikut
- start_cutscene(durasi)
- end_cutscene(durasi)
- Ganti durasi dengan angka.
- Terms of use :
- Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
- keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
- dipake buat komersil, jangan lupa, gw dibagi gratisannya.
- =end
- # =============================================================================
- # Konfig ~
- # =============================================================================
- module Theo
- module Cutscene
- Solid_Size = 10
- Gradient_Size = 45
- end
- end
- # =============================================================================
- # Akhir konfig ~
- # =============================================================================
- class Game_Interpreter
- def start_cutscene(dur)
- get_spriteset.start_cutscene(dur)
- end
- def end_cutscene(dur)
- get_spriteset.end_cutscene(dur)
- end
- end
- class Game_Temp
- attr_accessor :cutscene
- end
- class Cut_Sprites
- attr_reader :location
- def initialize(viewport, location)
- @viewport = viewport
- @solid_sprite = Sprite.new(viewport)
- @gradient_sprite = Sprite.new(viewport)
- @location = location
- width = Graphics.width
- @bitmap1 = Bitmap.new(width,Theo::Cutscene::Solid_Size)
- @bitmap2 = Bitmap.new(width,Theo::Cutscene::Gradient_Size)
- color1 = Color.new(0,0,0,255)
- color2 = Color.new(0,0,0,0)
- @solid_sprite.bitmap = @bitmap1
- @gradient_sprite.bitmap = @bitmap2
- @bitmap1.fill_rect(@bitmap1.rect,color1)
- if location == :up
- @bitmap2.gradient_fill_rect(@bitmap2.rect, color1, color2,true)
- @solid_sprite.y = 0
- @gradient_sprite.y = @solid_sprite.height
- else
- @bitmap2.gradient_fill_rect(@bitmap2.rect, color2, color1,true)
- @solid_sprite.y = Graphics.height - @solid_sprite.height
- @gradient_sprite.y = @solid_sprite.y - @gradient_sprite.height
- end
- @solid_sprite.z = 10
- @gradient_sprite.z = 10
- hide_position
- end
- def hide_position
- if location == :up
- @solid_sprite.y -= total_height
- @gradient_sprite.y -= total_height
- else
- @solid_sprite.y += total_height
- @gradient_sprite.y += total_height
- end
- end
- def total_height
- Theo::Cutscene::Solid_Size + Theo::Cutscene::Gradient_Size
- end
- def update
- @solid_sprite.update
- @gradient_sprite.update
- end
- def start(dur)
- if location == :up
- @solid_sprite.down(total_height,dur)
- @gradient_sprite.down(total_height,dur)
- else
- @solid_sprite.up(total_height,dur)
- @gradient_sprite.up(total_height,dur)
- end
- end
- def end(dur)
- if location == :up
- @solid_sprite.up(total_height,dur)
- @gradient_sprite.up(total_height,dur)
- else
- @solid_sprite.down(total_height,dur)
- @gradient_sprite.down(total_height,dur)
- end
- end
- def dispose
- @solid_sprite.dispose
- @gradient_sprite.dispose
- @bitmap1.dispose
- @bitmap2.dispose
- end
- end
- class Spriteset_Cutscene
- def initialize(viewport)
- @sprite_up = Cut_Sprites.new(viewport, :up)
- @sprite_down = Cut_Sprites.new(viewport, :down)
- end
- def update
- @sprite_up.update
- @sprite_down.update
- end
- def dispose
- @sprite_up.dispose
- @sprite_down.dispose
- end
- def start(dur)
- return if $game_temp.cutscene
- @sprite_up.start(dur)
- @sprite_down.start(dur)
- $game_temp.cutscene = true
- end
- def end(dur)
- return unless $game_temp.cutscene
- @sprite_up.end(dur)
- @sprite_down.end(dur)
- $game_temp.cutscene = false
- end
- end
- class Spriteset_Map
- alias theo_cutscene_viewport create_viewports
- def create_viewports
- theo_cutscene_viewport
- @cutscene_sprite = Spriteset_Cutscene.new(@viewport3)
- end
- alias theo_cutscene_update update
- def update
- theo_cutscene_update
- @cutscene_sprite.update
- end
- alias theo_cutscene_dispose dispose
- def dispose
- theo_cutscene_dispose
- @cutscene_sprite.dispose
- end
- def start_cutscene(dur)
- @cutscene_sprite.start(dur)
- end
- def end_cutscene(dur)
- @cutscene_sprite.end(dur)
- end
- end
- def get_spriteset
- SceneManager.scene.instance_variable_get("@spriteset")
- end
Advertisement
Add Comment
Please, Sign In to add comment