chaosBlenders
=* 99 Bilder Script *=
Da ich für mein aktuelles Spiel weit mehr als 20 Bilder brauche und ich bisher kein Script gesehen habe, dass dieses Problem löst, habe ich mich kurzerhand dazu entschlossen, einfach selbst ein Script zu schreiben und es der Community freizugeben.
Falls ein ähnliches Script bereits existieren sollte, wäre es schön, es zu sehen (vielleicht hat der Scripter nen einfacheren Ansatz als ich ^^).
Wundert mich eigentlich, dass ich so ein Script noch nicht gefunden hab, weil's eigentlich ziemlich simpel ist.
Wie wird es genutzt?
Die Bilder werden nicht über die "... Picture"-Aktionen angezeigt, sondern über ein "Call Script"-Event. Die Funktionen zum manuellen Anzeigen der Bilder waren bereits vorgegeben, jedoch durch ein Maximum von 20 Bildern limitiert.
Die einzelnen Funktionen sind:
[blockquote]
- screen.pictures[number].show(filename, origin, X, Y, Width, Height, Opacity, Blendmode)
[blockquote]Zeigt ein Bild an.
[/blockquote]
- screen.pictures[number].move(origin, X, Y, Width, Height, Opacity, Blendmode, Frames)
[blockquote]Bewegt ein Bild.
[/blockquote]
- screen.pictures[number].rotate(angle)
[blockquote]Dreht ein Bild.
[/blockquote]
- screen.pictures[number].start_tone_change(Tone, Frames)
[/blockquote][blockquote][blockquote]Färbt ein Bild ein.
[/blockquote]
- screen.pictures[number].erase
[blockquote]Löscht ein Bild
[/blockquote][/blockquote][blockquote][blockquote]Ausserdem kann
nach Funktionsaufruf man noch die Variable
[/blockquote][/blockquote][blockquote]
[blockquote]setzen, um
nach einer Bewegung oder Farbänderung, die angegebene Zahl an Frames zu warten.
[/blockquote][/blockquote]
Erklärung der Parameter:
[blockquote]
- number: Nummer des Bildes (1 - 99)
- filename: Dateiname des Bildes, in Anführungszeichen und ohne Erweiterung
- origin: Ursprung des Bildes - 0 = links oben, 1 = mitte
- X: X-Koordinate des Bildes
- Y: Y-Koordinate des Bildes
- Width: Breite des Bildes (100 = Standard)
- Height: Höhe des Bildes (100 = Standard)
- Opacity: Transparenz des Bildes (0 - 255)
- Blendmode: Überblendungsmodus (0 = normal, 1 = additiv, 2 = subtraktiv)
- frames: Animationsdauer (in frames, 60 frames = 1 sekunde)
- angle: Winkel des Bildes (0 - 360)
- Tone: Farbe des Bildes. Um Tone nutzen zu können, muss folgender Code als erster Parameter eingefügt werden:
- Tone.new(Rot, Grün, Blau, Grau)
[blockquote][blockquote]Rot, Grün, Blau = Rot-,Grün-,Blau-Wert (Standard: 0, zwischen -255 und 255)
Grau = Grau-Wert (Standard: 0, zwischen 0 und 255)
[/blockquote][/blockquote][/blockquote]
Gib jetzt endlich das Script!
Jaja, ist ja schon gut. Hier ist es:
######################################################################
# *99 Pictures Script* #
# by chaosblender #
#--------------------------------------------------------------------#
#USAGE: #
#--------------------------------------------------------------------#
#To show a picture, use the following script event: #
# screen.pictures[number].show(filename, origin, X, Y, Width, Height,#
# Opacity, Blendmode) #
# #
# number: Picture Number (1-99) #
# filename: Filename of the picture, without extension #
# (e.g. "my_picture") #
# origin: 0 - upper left corner, 1 - center #
# X: X-Coordinate #
# Y: Y-Coordinate #
# Width: Width of the picture, in percent #
# Height: Height of the picture, in percent #
# Opacity: Opacity (Transparency) of the picture (0-255) #
# Blendmode: 0 - normal, 1 - additive, 2 - subtractive #
#--------------------------------------------------------------------#
#To move a picture, use the following script event: #
# screen.pictures[number].move(origin, X, Y, Width, Height, Opacity, #
# Blendmode, Waitcount) #
# #
# Waitcount: Length of the animation (in frames) #
# #
# If you put the following line after that command... #
# #
# @wait_count = Waitcount #
# #
# ...the event will wait until the animation's done. #
#--------------------------------------------------------------------#
#To rotate a picture, use the following script event: #
# screen.pictures[number].rotate(angle) #
# #
# angle: Angle of the picture (0-360) #
#--------------------------------------------------------------------#
#--------------------------------------------------------------------#
#To tint a picture, use the following script event: #
# screen.pictures[number].start_tone_change(Tone, Waitcount) #
# #
# Tone: The Tone of the Picture (usage: Tone.new(Red,Green,Blue,Grey)#
# example: Tone.new(0,0,0,0) would be the default tone #
# Red, Green, Blue are numbers between -255 and 255 #
# Grey is a number between 0 and 255 #
# #
# Waitcount: Length of the animation (in frames) #
# #
# If you put the following line after that command... #
# #
# @wait_count = Waitcount #
# #
# ...the event will wait until the animation's done. #
#--------------------------------------------------------------------#
#To delete a picture, use the following script event: #
# screen.pictures[number].erase #
#--------------------------------------------------------------------#
# ! If you're going to use this script in your game, it would be nice#
# ! adding me (chaosBlender) to your credits #
# #
# HAVE FUN! #
######################################################################
class Game_Screen
alias old_clear clear
def clear
old_clear
for i in 0..99
@pictures.push(Game_Picture.new(i))
end
end
end
class Spriteset_Map
def create_pictures
@picture_sprites = []
for i in 1..99
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_map.screen.pictures[i]))
end
end
end
class Spriteset_Battle
def create_pictures
@picture_sprites = []
for i in 1..99
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_troop.screen.pictures[i]))
end
end
end
Anmerkung: Wenn ihr das Script in eurem Projekt nutzt, wäre es nett, mich (chaosBlender) in den Credits zu erwähnen.
In diesem Sinne noch viel Spaß beim Makern mit 99 Bildern wünscht
-chaosBlender