October 15, 2024, 01:59:54 PM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
IRC channel - server:
waelisch.de
channel:
#wme
(
read more
)
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Existing entity on layer
« previous
next »
Pages: [
1
]
Print
Author
Topic: Existing entity on layer (Read 3594 times)
0 Members and 1 Guest are viewing this topic.
Adventure Bird
Lurker
Karma: 0
Offline
Posts: 13
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
Gender:
Posts: 1511
Vampires!
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
var
layer =
Scene
.
GetLayer
(
"layer name"
)
;
var
ent = layer.
AddEntity
(
"myTest"
)
;
ent.
SetSpite
(
[
path to file
]
)
;
ent.
X
=
123
;
ent.
Y
=
232
;
ent.
Active
=
true
;
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
Gender:
Posts: 5683
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.
Adventure Bird
Lurker
Karma: 0
Offline
Posts: 13
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
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Existing entity on layer