Class: Clutter::State
- Inherits:
-
Object
- Object
- Clutter::State
- Defined in:
- (unknown)
Overview
The Clutter::StateClass structure contains only private data
Instance Method Summary collapse
-
#duration ⇒ Integer
Default duration used if an duration has not been specified for a specific source/target state pair.
-
#duration=(duration) ⇒ Integer
Default duration used if an duration has not been specified for a specific source/target state pair.
-
#get_animator(source_state_name, target_state_name) ⇒ Clutter::Animator
Retrieves the Clutter::Animator that is being used for transitioning between the two states, if any has been set.
-
#get_duration(source_state_name, target_state_name) ⇒ Integer
Queries the duration used for transitions between a source and target state pair.
-
#get_keys(source_state_name, target_state_name, object, property_name) ⇒ GLib::List<Clutter::StateKey>
Returns a list of pointers to opaque structures with accessor functions that describe the keys added to an animator.
-
#initialize ⇒ Clutter::State
constructor
Creates a new Clutter::State.
-
#remove_key(source_state_name, target_state_name, object, property_name) ⇒ nil
Removes all keys matching the search criteria passed in arguments.
-
#set(source_state_name, target_state_name, first_object, first_property_name, first_mode, array) ⇒ nil
Adds multiple keys to a named state of a Clutter::State instance, specifying the easing mode and value a given property of an object should have at a given progress of the animation.
-
#set_animator(source_state_name, target_state_name, animator) ⇒ nil
Specifies a Clutter::Animator to be used when transitioning between the two named states.
-
#set_duration(source_state_name, target_state_name, duration) ⇒ nil
Sets the duration of a transition.
-
#set_key(source_state_name, target_state_name, object, property_name, mode, value, pre_delay, post_delay) ⇒ Clutter::State
Sets one specific end key for a state name, object, property_name combination.
-
#state ⇒ String
The currently set target state, setting it causes the state machine to transition to the new state, use clutter_state_warp_to_state() to change state without a transition.
-
#state=(state) ⇒ String
The currently set target state, setting it causes the state machine to transition to the new state, use clutter_state_warp_to_state() to change state without a transition.
-
#states ⇒ GLib::List<String>
Gets a list of all the state names managed by this Clutter::State.
-
#timeline ⇒ Clutter::Timeline
Gets the timeline driving the Clutter::State.
-
#warp_to_state(target_state_name) ⇒ Clutter::Timeline
Change to the specified target state immediately with no animation.
Constructor Details
#initialize ⇒ Clutter::State
Creates a new Clutter::State
Instance Method Details
#duration ⇒ Integer
Default duration used if an duration has not been specified for a specific source/target state pair. The values is in milliseconds.
#duration=(duration) ⇒ Integer
Default duration used if an duration has not been specified for a specific source/target state pair. The values is in milliseconds.
#get_animator(source_state_name, target_state_name) ⇒ Clutter::Animator
Retrieves the Clutter::Animator that is being used for transitioning between the two states, if any has been set
#get_duration(source_state_name, target_state_name) ⇒ Integer
Queries the duration used for transitions between a source and target state pair
The semantics for the query are the same as the semantics used for setting the duration with clutter_state_set_duration()
#get_keys(source_state_name, target_state_name, object, property_name) ⇒ GLib::List<Clutter::StateKey>
Returns a list of pointers to opaque structures with accessor functions that describe the keys added to an animator.
#remove_key(source_state_name, target_state_name, object, property_name) ⇒ nil
Removes all keys matching the search criteria passed in arguments.
#set(source_state_name, target_state_name, first_object, first_property_name, first_mode, array) ⇒ nil
Adds multiple keys to a named state of a Clutter::State instance, specifying the easing mode and value a given property of an object should have at a given progress of the animation.
The mode specified is the easing mode used when going to from the previous key to the specified key.
For instance, the code below:
|[ clutter_state_set (state, NULL, "hover", button, "opacity", CLUTTER_LINEAR, 255, button, "scale-x", CLUTTER_EASE_OUT_CUBIC, 1.2, button, "scale-y", CLUTTER_EASE_OUT_CUBIC, 1.2, NULL); ]|
will create a transition from any state (a source_state_name or NULL is treated as a wildcard) and a state named "hover"; the button object will have the Clutter::Actor:opacity property animated to a value of 255 using %CLUTTER_LINEAR as the animation mode, and the Clutter::Actor:scale-x and #ClutterActor:scale-y properties animated to a value of 1.2 using %CLUTTER_EASE_OUT_CUBIC as the animation mode. To change the state (and start the transition) you can use the clutter_state_set_state() function:
|[ clutter_state_set_state (state, "hover"); ]|
If a given object, state_name, property tuple already exist in the Clutter::State instance, then the mode and value will be replaced with the new specified values.
If a property name is prefixed with "delayed::" two additional arguments per key are expected: a value relative to the full state time to pause before transitioning and a similar value to pause after transitioning, e.g.:
|[ clutter_state_set (state, "hover", "toggled", button, "delayed::scale-x", CLUTTER_LINEAR, 1.0, 0.2, 0.2, button, "delayed::scale-y", CLUTTER_LINEAR, 1.0, 0.2, 0.2, NULL); ]|
will pause for 20% of the duration of the transition before animating, and 20% of the duration after animating.
#set_animator(source_state_name, target_state_name, animator) ⇒ nil
Specifies a Clutter::Animator to be used when transitioning between the two named states.
The animator allows specifying a transition between the state that is more elaborate than the basic transitions allowed by the tweening of properties defined in the Clutter::State keys.
If animator is nil it will unset an existing animator.
Clutter::State will take a reference on the passed animator, if any
#set_duration(source_state_name, target_state_name, duration) ⇒ nil
Sets the duration of a transition.
If both state names are nil the default duration for state is set.
If only target_state_name is specified, the passed duration becomes the default duration for transitions to the target state.
If both states names are specified, the passed duration only applies to the specified transition.
#set_key(source_state_name, target_state_name, object, property_name, mode, value, pre_delay, post_delay) ⇒ Clutter::State
Sets one specific end key for a state name, object, property_name combination.
#state ⇒ String
The currently set target state, setting it causes the state machine to transition to the new state, use clutter_state_warp_to_state() to change state without a transition.
#state=(state) ⇒ String
The currently set target state, setting it causes the state machine to transition to the new state, use clutter_state_warp_to_state() to change state without a transition.
#states ⇒ GLib::List<String>
Gets a list of all the state names managed by this Clutter::State.
#timeline ⇒ Clutter::Timeline
Gets the timeline driving the Clutter::State
#warp_to_state(target_state_name) ⇒ Clutter::Timeline
Change to the specified target state immediately with no animation.
See clutter_state_set_state().