Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 [RGSS3] Kuro Easy Pic

Topik sebelumnya Topik selanjutnya Go down 
[RGSS3] Kuro Easy Pic Empty2014-12-16, 20:10
Post[RGSS3] Kuro Easy Pic
#1
Kuro Ethernite 
The Creator
Kuro Ethernite

Level 5
Posts : 1631
Thanked : 24
Engine : RMVX Ace
Skill : Masterful
Type : Jack of All Trades
Awards:

[RGSS3] Kuro Easy Pic Vide
Kuro Easy Pic
V1.1
Tipe: Eventer Tool


Pengenalan
Semenjak AES yang ku buat cenderung banyak show picture dan seneng bikin dialog berbau VN maka terlahirlah script ini. Ku akui untuk yang sekarang masih amburadul. Well, yang penting jalan... :v
Kalo ku apdet sekalian rapihinnya lah.


Fitur

  • Soft Render, Show Picture dan Erase Picture kini jadi lembut ~
  • Grid buatan untuk memudahkan koordinir posisi gambar.
  • Mendeklarasikan initial point sebagai awal picture muncul dan posisi picture berakhir ketika show atau erase.
  • New Method : drawclone
    Picture meninggalkan "shadow image" ketika show picture setelah picture. Intinya jadi lebih lembut lah.
  • New Method : shake picture
    Picture nya bisa dikocok-kocok.
  • New Method : flip picture
    horizontal flip, yea!
  • New Method : "literally" rotate picture
    Perintah "rotate picture" kini nggak lagi nge "spin" picture, tapi nge "rotate" picture nya ke targe derajat.
  • Demo nya unyu. Cobain deh~



Screenshots
[RGSS3] Kuro Easy Pic Kuro%20Easy%20Pic


Demo
https://db.tt/BPXPVGAC V1.1


scripts
Code:
=begin
================================================================================
                              KURO EASY PIC V1.1
================================================================================
Introduction :
Picture management is one of most powerful tool for eventer. Though most are too
lazy to use its maximum potential, this script allow to manage and handle event
picture for convenient purpose.
================================================================================
Changelog :
  V.1.1 (19-12-2014)
    * Fixed Bug : When you try to erase picture that already erased.
    * Rotate picture now literally rotate the picture. Not spin.
    * New Method : drawclone which produce after-image when show picture after
      picture which allow more natural soft render.
    * New Method : Flip Picture
  V.1.0 (16-12-2014)
    * Awal pembuatan, dan selesainya script.
    * New Method : Shake Picture
    * Amburadul banget script nya, well yang penting jadi
================================================================================
Feature :
- Soft Render : Show Picture dan Erase Picture kini jadi lembut.
- Grid        : Grid buatan untuk memudahkan koordinir posisi picture.
- Initial     : Mendeklarasikan initial point sebagai awal dan akhir picture.
- New Method  : Shake
================================================================================
How to use :
Insert this script below ¥ Materials, but above ¥ Main Process.
* Untuk kocok-kocok picture.
  screen.picture[ID].shake(DUR)
  ID  = id picture
  DUR = durasi kocok-kocoknya
* Untuk rubah-rubah konfigurasi di tengah game
  Kuro::Pic::PROP = VALUE
  PROP  = Bisa BOUND, DUR, atau GRID.
  VALUE = Nilai property. Sesuaikan dengan format.
================================================================================
=end
module Kuro
  module Pic
# ==============================================================================
# CONFIGURATION START
# ==============================================================================
  # BOUND = N, maka hanya picture ID 1 sampai N saja yang pake script ini.
    BOUND = 10

  # Durasi Soft Render untuk show picture dan erase picture.
    DUR   = 30

  # Grid = [width, height]
    GRID = [544/3, 416/3]

  # Kondisi awal dan akhir picture ID.
    INIT = {
  #   ID  => [origin, x, y, zoom_x, zoom_y, opacity, blend_type, mirror]
      1   => [     0, -1,1,    100,    100,       0,          0,  false],
      2   => [     0,  3,1,    100,    100,       0,          0,  false]
    }
  # Besar kekuatan kocok-kocok nya.
    SHAKE = 4
# ==============================================================================
# CONFIGURATION END
# ==============================================================================
  end
end
class Game_Picture
  include Kuro::Pic
  attr_reader   :mirror

  def initialize(number)
    @number = number
    init_basic
    init_target
    init_tone
    init_rotate
    @shake_duration = 0
    @mirror = false
  end
  def kep_init
    return unless INIT.include?(@number) and @name == ""
    @origin     = INIT[@number][0]
    @x          = (INIT[@number][1]*GRID[0]).to_f
    @y          = (INIT[@number][2]*GRID[1]).to_f
    @zoom_x     = INIT[@number][3].to_f
    @zoom_y     = INIT[@number][4].to_f
    @opacity    = INIT[@number][5].to_f
    @blend_type = INIT[@number][6]
    @mirror     = INIT[@number][7]
  end
  def kep_end
    move(INIT[@number][0],INIT[@number][1].to_f,INIT[@number][2].to_f,
    INIT[@number][3].to_f,INIT[@number][4].to_f,INIT[@number][5].to_f,
    INIT[@number][6],DUR)
  end
  def init_rotate
    @angle = 0
    @rotate_speed = 0
    @rotate_duration = 0
  end
  alias kep_show show
  def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
    if @number <= BOUND
      drawclone
      @origin = origin
      @x = x*GRID[0]
      @y = y*GRID[1]
      @zoom_x = zoom_x
      @zoom_y = zoom_y
      @opacity = 0.0
      kep_init
      @name = name
      @erased = false
      move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, DUR)
    else
      kep_show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
    end
  end
  def drawclone
    return if @opacity == 0.0 or @name == ""
    $game_map.screen.pictures[100+@number].show(@name,@origin,@x,@y,@zoom_x,@zoom_y,@opacity,@blend_type)
    $game_map.screen.pictures[100+@number].move(@origin,@x,@y,@zoom_x,@zoom_y,0.0,@blend_type,DUR)
  end
  alias kep_move move
  def move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
    kep_move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
    if @number <= BOUND
      @target_x *= GRID[0]
      @target_y *= GRID[1]
    end
  end
  alias kep_erase erase
  def erase
    if @number <= BOUND
      @name = "" if @erased
      return if @name == ""
      if INIT.include?(@number)
        kep_end
      else
        move(@origin, @x/GRID[0], @y/GRID[1], @zoom_x, @zoom_y, 0.0, @blend_type, DUR)
      end
      @erased = true
    else
      kep_erase
    end
  end
  def rotate(speed, duration=DUR)
    @rotate_speed = speed
    if @number <= BOUND
      @rotate_duration = duration
      @rotate_speed *= 2
    end
  end
  def flip
    @mirror = !@mirror
  end
  def shake(duration=DUR)
    @shake_duration = duration
    @last_x = @x
    @last_y = @y
  end
  def update
    update_move
    update_tone_change
    update_rotate
    update_shake
  end
  def update_shake
    return if @shake_duration == 0
    @x = @last_x + rand(SHAKE) - SHAKE/2
    @y = @last_y + rand(SHAKE) - SHAKE/2
    @shake_duration -= 1
    if @shake_duration == 0
      @x = @last_x
      @y = @last_y
    end
  end
  def update_move
    return if @duration == 0
    d = @duration
    @x = (@x * (d - 1) + @target_x) / d
    @y = (@y * (d - 1) + @target_y) / d
    @zoom_x  = (@zoom_x  * (d - 1) + @target_zoom_x)  / d
    @zoom_y  = (@zoom_y  * (d - 1) + @target_zoom_y)  / d
    @opacity = (@opacity * (d - 1) + @target_opacity) / d
    initialize(@number) if @opacity == 0.0 and @erased
    @duration -= 1
  end
  alias kep_update_rotate update_rotate
  def update_rotate
    if @number <= BOUND
      return if @rotate_duration == 0
      d = @rotate_duration
      @angle = (@angle * (d - 1) + @rotate_speed) / d
#~       @angle %= 360
      @rotate_duration -= 1
    else
      kep_update_rotate
    end
  end
end
class Sprite_Picture < Sprite
  alias kep_update_other update_other
  def update_other
    kep_update_other
    self.mirror = @picture.mirror
  end
end



How to use?
Konfigurasi preset ada di dalam module.
Scriptnya bakal nge overwrite method show picture dan erase picture, dan nambahin method baru shake. Tapi ya selama ID picture yang kena dampak udah di set...
Untuk lebih jelasnya lihat di demo.



Credits
Kuro Creator


Spoiler:
 

[RGSS3] Kuro Easy Pic Empty2014-12-19, 17:53
PostRe: [RGSS3] Kuro Easy Pic
#2
Kuro Ethernite 
The Creator
Kuro Ethernite

Level 5
Posts : 1631
Thanked : 24
Engine : RMVX Ace
Skill : Masterful
Type : Jack of All Trades
Awards:

[RGSS3] Kuro Easy Pic Vide
Hmm, blom ku rapihin. Tapi ane apdet jadi lebih banyak fitur...
Personally ane pikir ni script jauh lebih baik dibanding script type picture management lain nya semenjak ini memenuhi kebutuhan eventer yang gak mau repot.

Apdet ke V1.1 ~
  • Nambahin flip picture dan nge overwrite rotate picture.
  • Nambahin shadow image jadi lebih halus ketika show picture setelah picture.
  • Fixed error ketika nyoba ngehapus picture yang udah kehapus.


Spoiler:
 

 

[RGSS3] Kuro Easy Pic

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMVX Ace Scripts-