Libgdx Study Notes: Group of scene2d

Source: Internet
Author: User
Tags libgdx
Group of UI Components

When a group is rotated or scaled, its children are drawn normally, and the batch is correctly rotated or scaled after the change.

Before the Group is drawn, the batch flush enables you to set the transformation. When there are many groups, this may become a performance bottleneck. If a group of actors do not rotate or scale, settransform (false) can be used for group. In this way, each child's location is drawn based on the group location so that the child appears in the correct location even if no conversion.

GroupInherited from actor. It is a node drawn in 2D scenarios and contains many other actors;

Each actor has a z-order that is equal to the order in which they are inserted into the group. The inserted result is displayed on the top of the inserted result.

Touch events are preferentially distributed to actors at the top layer.

Common Methods:

VoidAddactor(ActorActor)

Add an actor to a group as a sub-element.

VoidAddactorat(INT index,ActorActor)

Add an actor to a group as a sub-element.

Fixed on a level. If the index exceeds the size of the sub-array, the actor is inserted to the top layer.

Settransform (Boolean tansform)

The default value is true, indicating that the Group neutron element has rotation and scaling operations.

Before the Group is drawn, applytransform will be performed first, and then the resettransform will be flush () of batch for two operations. There will be performance bottleneck problems. If the sub-element has no rotation or scaling operation, you can set settransform (false ).

Classes inherited from the group include widgetgroup.


Libgdx Study Notes: Group of scene2d

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.