Well, if the 'pictures' value is the array within the Game_Screen class, you, then we have a decipherable problem.
You have some value called 'screen', in your 'screen.pictures[1]' code. If this was meant to be the pictures array in Game_Screen, you would instead use ...
$game_screen.pictures[1]...
This would make since with RMXP, VX and VXAce. Same basic Game_Screen class, though coded slightly differently, and both the Game_Map and Game_Troop classes access the Game_Screen class with...
@screen = Game_Screen.new
Note the '@' to make make the @screen value which can be accessed throughout that particular class.
But if 'screen' is not meant to reflect the Game_Screen class, more of your script may be needed.
If you are making a new scene, forget about event commands, even if they are "translated" to scripts. They won't work on most scenes anyway.
You should not use them in new, custom scenes, only on the map scene and other map related things, and only if you really need them, which is rare, actually.
If you want to show a picture, use a simple sprite, and assign your image as a bitmap for it.
This is how you create images on the game's screen in any scene.
But all sprites must be disposed correctly upon leaving the scene, that is mandatory.
You can do that this way:
@pic.bitmap.dispose
@pic.dispose
First, you dispose the bitmap, than the sprite itself. You should call this either in the scene class' 'terminate' or 'dispose_all_windows' method.
To move around the image, you can alter it's Y position in the 'update' method of the scene class. Just make your conditions (when to start, where to stop, etc) and based on those, move your image how you like.
For example:
def update
super
# If the image is visible on the screen, move the image upwards
if @pic.y > -@pic.bitmap.height
@pic.y -= 1 # 1 is the speed of the movement
end
end
This example will scroll the image upwards until it gets out of screen completely. It assumes that the starting Y position was 0 (top of the screen) for the sprite.
I just assumed that you want to make a scrolling credit list (judging by your script and method names), that's why I wrote these examples.
Based on what other things you want to do on that scene, you will need to add other code-bits obviously. I recommend you to search for some tutorials on how to manipulate sprites in Ruby. Once you learn that, working with images will be as easy as hitting the bed at the end of the day.
If you got no such instance variable which is a sprite, you can't really dispose it's bitmap (or itself), right?
If you do have a sprite named like that, but it is initialized at a later point, just add a condition to that method which checks if there is a @sprite variable or not before doing something with it.
You can do that with a simple "if @sprite" check.
It might help if we could see the whole script. Guessing the source of the error is often more time consuming than it should be.
Vegan post. Pic of a pig in a suit and tie like he is laying in a coffin but it's a sandwich. 'One meal soon forgotten, in exchange for a whole life." Really don't think rolling around in poop your whole life would be so valuable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.