Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Existing entity on layer  (Read 2902 times)

0 Members and 1 Guest are viewing this topic.

Adventure Bird

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Existing entity on layer
« on: August 25, 2009, 11:20:50 PM »

I want to display some prepared entities on the top layer of the scene. In the sdk I found just a method to create new entity on a layer. (add/insert)

Is it possible to load an entity like that: Scene.LoadEntity(). // Into which layer will entity be loaded, always main layer?

Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Existing entity on layer
« Reply #1 on: August 26, 2009, 07:42:13 AM »

well, AFAIK you have two options.

1, use Layer.InsertEntity (or Layer.AddEntity) which creates an empty entity in the Layer which can be customized in the runtime.
2, set those entities in the Scene editor and change their Active state

Unless there is some undocumented feature, for layer operations you can't load an entity file.

example:
Code: WME Script
  1. var layer = Scene.GetLayer("layer name");
  2. var ent = layer.AddEntity("myTest");
  3. ent.SetSpite([path to file]);
  4. ent.X = 123;
  5. ent.Y = 232;
  6. ent.Active = true;
  7.  
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Existing entity on layer
« Reply #2 on: August 26, 2009, 08:32:55 AM »

So-called "free entities" (i.e. those that live in external files or are created with CreateEntity() ) can only exist in the main layer. So, meta is right.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Adventure Bird

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Existing entity on layer
« Reply #3 on: August 26, 2009, 07:56:55 PM »

Thank I use the way be add dynamic entities now.
Logged
 

Page created in 0.044 seconds with 20 queries.