Actors¶
Contents
Actor¶

-
class
serge.actor.
Actor
(tag, name='')[source]¶ Bases:
serge.common.Loggable
,serge.geometry.Rectangle
,serge.common.EventAware
Represents an actor
-
moveTo
(x, y, no_sync=False, override_lock=False)[source]¶ Move the center of this actor to the given location, unless it is locked
You can override the lock by passing True to override lock.
-
setRenderingOrder
(order)[source]¶ Sets the order to render to the screen
You can set this to adjust when objects are rendered even within a layer. A lower number means that an actor will be rendered earlier - which means it will be behind others.
The default is 0, so you should set this to higher than 1000 if you want an actor to appear in front of other objects that have not been explicitly set.
-
CompositeActor¶

-
class
serge.actor.
CompositeActor
(*args, **kw)[source]¶ Bases:
serge.actor.Actor
An actor that can have children, which are also actors
World operations on the parent, like adding and removing, will also apply to the children.
If the children are removed from the parent then they are also removed from the world.
AbstractMountableActor¶

-
class
serge.actor.
AbstractMountableActor
(*args, **kw)[source]¶ Bases:
serge.actor.CompositeActor
An base class for actors that you can mount other actors to
The other actors are located at a certain position relative to the position of this actor. You can use this actor to create clusters either visually or functionally.
-
mountActor
()[source]¶ Mount the actor with the given offset
If original_rotation is True then the mount offset is taken as working against the original rotation (ie angle = 0) of the actor.
If rotate_with_actor is set to False then this actor will not rotate with the parent actor, it will just move.
-
MountableActor¶

-
class
serge.actor.
MountableActor
(*args, **kw)[source]¶ Bases:
serge.actor.AbstractMountableActor
An actor that you can mount other actors to
The other actors are located at a certain position relative to the position of this actor. You can use this actor to create clusters either visually or functionally.
PhysicallyMountableActor¶

-
class
serge.actor.
PhysicallyMountableActor
(tag, name='', mass=0.0, **kw)[source]¶ Bases:
serge.actor.AbstractMountableActor
An physical actor that you can mount other physical actors to
The other actors are located at a certain position relative to the position of this actor. You can use this actor to create clusters either visually or functionally.
All actors must be under the control of the physics engine.
ActorCollection¶

-
class
serge.actor.
ActorCollection
[source]¶ Bases:
list
A list of actors
This class implements some useful methods which help to handle collections of actors.