get_width


Description:

public float get_width ()

Retrieves the width of a Actor.

If the actor has a valid allocation, this function will return the width of the allocated area given to the actor.

If the actor does not have a valid allocation, this function will return the actor's natural width, that is the preferred width of the actor.

If you care whether you get the preferred width or the width that has been assigned to the actor, you should probably call a different function like get_allocation_box to retrieve the allocated size or get_preferred_width to retrieve the preferred width.

If an actor has a fixed width, for instance a width that has been assigned using set_width, the width returned will be the same value.

Parameters:

this

A Actor

Returns:

the width of the actor, in pixels