Forums

OverviewV-Play 1 SupportAccessing Properties › Reply To: Accessing Properties

OverviewV-Play 1 SupportAccessing Properties › Reply To: Accessing Properties
#7179

Christian
V-Play Team

Hi bliss,

nice to see you’re working full steam on your project :)

To your question, your code would be correct but the thing is, you can’t access an element inside a Component from the outside. This is because Components describe the structure of elements that will be created in the future and do not exist yet.

So to access properties of elements created from Components with EntityManager, you need to access them via entityManager.getEntityById().

Your code could look like this:


//find entity with ID == 1
var entity = entityManager.getEntityById(1);

//access entity property
var numOfRow = jsonObj.length / entity.numOfCol;

Hope this helps!

Cheers, Chrisu

  • This reply was modified 4 years, 3 months ago by  Chrisu.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support