Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning AndEngine

You're reading from   Learning AndEngine Design and create Android games with the simple but powerful tool AndEngine

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher
ISBN-13 9781783985968
Length 286 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Martin Varga Martin Varga
Author Profile Icon Martin Varga
Martin Varga
Arrow right icon
View More author details
Toc

Entities

Everything you can display in AndEngine is an entity. The Entity class is a basic class that stands on top of the hierarchy. The Entity class has all the parameters the displayable objects need, such as position, scale factor, color, and so on. But on its own, it doesn't display anything.

The Entity class can also have children, both in Java class hierarchy and in the hierarchy of AndEngine objects.

For the former case, let's take the Sprite class as an example. A sprite in AndEngine is a simple image rendered on a quad (a square made of two triangles). The Sprite class extends the Shape class, which already knows what to do when the programmer sets its height and width; therefore, the Sprite class doesn't need to implement it. Also, the Shape class extends the Entity class. See the following diagram for another example:

Entities

The latter case means that you can attach one entity to another. It doesn't matter what type it is, whether it's a sprite, shape, or anything...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image