visiomode.stimuli.Stimulus

class visiomode.stimuli.Stimulus(background, **kwargs)

Bases: Sprite, BaseClassMixin, WebFormMixin

__init__(background, **kwargs)

Methods

__init__(background, **kwargs)

add(*groups)

add the sprite to groups

add_internal(group)

For adding this sprite to a group internally.

alive()

does the sprite belong to any groups

collision(x, y)

draw()

generate_new_trial()

Regenerate stimuli for a fresh trial

get_child(child_id)

get_children()

Return all inheriting children as a list.

get_common_name()

"Return the human-readable, space-separated name for the class.

get_details()

Returns a dictionary of stimulus attributes.

get_form()

get_identifier()

Generate lowercase identifier for the class.

groups()

list of Groups that contain this Sprite

hide()

kill()

remove the Sprite from all Groups

remove(*groups)

remove the sprite from groups

remove_internal(group)

For removing this sprite from a group internally.

set_centerx(centerx)

show()

update([timedelta])

method to control sprite behavior

Attributes

form_path

layer

Dynamic, read only property for protected _layer attribute.

add(*groups)

add the sprite to groups

Sprite.add(*groups): return None

Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of.

add_internal(group)

For adding this sprite to a group internally.

Parameters

group – The group we are adding to.

alive()

does the sprite belong to any groups

Sprite.alive(): return bool

Returns True when the Sprite belongs to one or more Groups.

generate_new_trial()

Regenerate stimuli for a fresh trial

classmethod get_children()

Return all inheriting children as a list.

classmethod get_common_name()

“Return the human-readable, space-separated name for the class.

get_details()

Returns a dictionary of stimulus attributes.

classmethod get_identifier()

Generate lowercase identifier for the class.

groups()

list of Groups that contain this Sprite

Sprite.groups(): return group_list

Returns a list of all the Groups that contain this Sprite.

kill()

remove the Sprite from all Groups

Sprite.kill(): return None

The Sprite is removed from all the Groups that contain it. This won’t change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups.

property layer

Dynamic, read only property for protected _layer attribute. This will get the _layer variable if it exists.

If you try to get it before it is set it will raise an attribute error.

Layer property can only be set before the sprite is added to a group, after that it is read only and a sprite’s layer in a group should be set via the group’s change_layer() method.

Returns

layer as an int, or raise AttributeError.

remove(*groups)

remove the sprite from groups

Sprite.remove(*groups): return None

Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of.

remove_internal(group)

For removing this sprite from a group internally.

Parameters

group – The group we are removing from.

update(timedelta=0)

method to control sprite behavior

Sprite.update(*args, **kwargs):

The default implementation of this method does nothing; it’s just a convenient “hook” that you can override. This method is called by Group.update() with whatever arguments you give it.

There is no need to use this method if not using the convenience method by the same name in the Group class.