Declaration [src]

clutter_actor_get_resource_scale (
  ClutterActor* self

Description [src]

Retrieves the resource scale for this actor.

The resource scale refers to the scale the actor should use for its resources. For example if an actor draws a a picture of size 100 x 100 in the stage coordinate space, it should use a texture of twice the size (i.e. 200 x 200) if the resource scale is 2.

The resource scale is determined by calculating the highest ClutterStageView scale the actor will get painted on.

Note that the scale returned by this function is only guaranteed to be correct when queried during the paint cycle, in all other cases this function will only return a best guess. If your implementation really needs to get a resource scale outside of the paint cycle, make sure to subscribe to the “resource-scale-changed” signal to get notified about the new, correct resource scale before painting.

Also avoid getting the resource scale for actors that are not attached to a stage. There’s no sane way for Clutter to guess which ClutterStageView the actor is going to be painted on, so you’ll probably end up receiving the “resource-scale-changed” signal and having to rebuild your resources.

The best guess this function may return is usually just the last resource scale the actor got painted with. If this resource scale couldn’t be found because the actor was never painted so far or Clutter was unable to determine its position and size, this function will return the resource scale of a parent.

Return value

Type: float

The resource scale the actor should use for its textures.