- Joined
- Jan 28, 2016
- Messages
- 30
- Reaction score
- 0
- First Language
- English
- Primarily Uses
What happens (I walk up to press the event)
What is in the event I press: animatedimages(-110, -125, "FemaleMed", 1, 24)
What does that do? animatedimages(x position, y position, Graphics/Pictures/(Location)/1.png, looping?, frames in folder)
What do you mean black screen? Look below at the gif.
The code:
Why the whole code? I don't know where the error is happening.
class Scene_DataHolder < Scene_Base
def prepare(x, y, path, loop, frames)
@window_x = x
@window_y = y
@path = path
@loop = loop
@frames = frames
@newframes = 1
@rect = Rect.new(@window_x, @window_y, 0, 0)
@image = Sprite.new
create_background
create_window
end
def update
Graphics.wait(10)
@newframes += 1
if @newframes != @frames
@image.bitmap.clear
@image.bitmap.clear_rect(@rect)
create_window
end
else if @newframes == @frames
if @loop == 1
resetframes
end
else if @loop == 0
SceneManager.return if $frames == 0
end
end
end
def resetframes
@newframes = 1
update
end
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
end
def create_window
@rect.set(@window_x, @window_y, 0, 0)
@image.bitmap = Bitmap.new("Graphics/Pictures/" + @path + "/" + @newframes.to_s + ".png")
end
end
class Game_Interpreter
def animatedimages(x, y, path, loop, frames)
SceneManager.call(Scene_DataHolder)
SceneManager.scene.prepare(x, y, path, loop, frames)
end
end
Code updated
What is in the event I press: animatedimages(-110, -125, "FemaleMed", 1, 24)
What does that do? animatedimages(x position, y position, Graphics/Pictures/(Location)/1.png, looping?, frames in folder)
What do you mean black screen? Look below at the gif.
The code:
Why the whole code? I don't know where the error is happening.
class Scene_DataHolder < Scene_Base
def prepare(x, y, path, loop, frames)
@window_x = x
@window_y = y
@path = path
@loop = loop
@frames = frames
@newframes = 1
@rect = Rect.new(@window_x, @window_y, 0, 0)
@image = Sprite.new
create_background
create_window
end
def update
Graphics.wait(10)
@newframes += 1
if @newframes != @frames
@image.bitmap.clear
@image.bitmap.clear_rect(@rect)
create_window
end
else if @newframes == @frames
if @loop == 1
resetframes
end
else if @loop == 0
SceneManager.return if $frames == 0
end
end
end
def resetframes
@newframes = 1
update
end
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
end
def create_window
@rect.set(@window_x, @window_y, 0, 0)
@image.bitmap = Bitmap.new("Graphics/Pictures/" + @path + "/" + @newframes.to_s + ".png")
end
end
class Game_Interpreter
def animatedimages(x, y, path, loop, frames)
SceneManager.call(Scene_DataHolder)
SceneManager.scene.prepare(x, y, path, loop, frames)
end
end
Code updated
Last edited by a moderator:
