Animated objects on the screen.

Started by stars, Fri 14/08/2009 10:35:40

Previous topic - Next topic

stars

I have several animated loops which I have created as views.  Just cant figure out how to add the animated "things" to my rooms.  I dont really want to do a complete animated background.  

I have checked the manual and looked through the forums but either am looking for the wrong thing or it isnt there. (Which I doubt).

Say I have an animated flag and want it to show on my background.  Just want to place it on the background et voila.  A bit like a character I guess.

Matti

You create an object and use object.Animate to animate it. It's all in the manual.

Khris

Yeah, going from your first post here you know about objects, so what exactly is the problem?
Add the "player enters screen before fadein" event the room, in there animate the objects using eRepeat and set their .Clickable to false.

stars

Thanks for the help. I am getting some success now.  Just need to sort out the enters room before fadein as the screen just goes black.  I will check the manual....

stars

Okay got it sorted.  I guess i didnt understand the relationsship with objects and views etc.

Heres what I did.

Created an object.
Assigned a view

function room_Load()
{
object[0].SetView(2);
}


function room_AfterFadeIn()
{
object[0].Animate(0, 5, eRepeat,  eNoBlock);
}

tzachs

Hi, a little piece of advice regarding your code... When you create an object, you can name it in the designer (to say, "oFlag"), and then you can use the flag object like so:

oFlag.SetView(2);

This way, the code is more readable then if you use object[0], and if you'll look at the code a couple of months from now you'll be able to understand what you did more easily. The object structure is intended to be used if you want to access your object from outside the room you're in (and then you can't use the name of the object since it is only created locally in the room).

Khris

stars, you can move the .Animate command to the room_Load function I think.

suicidal pencil

to my knowledge, the only things that are allowed to animate are Characters and Objects.

SMF spam blocked by CleanTalk