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: z-order coding question  (Read 3129 times)

0 Members and 1 Guest are viewing this topic.

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile
z-order coding question
« on: April 02, 2008, 04:28:03 PM »

Hey,
Let say I want to have a 2d entity floating near my 3d actor's head, in the same Z-order my actor is in.

I have tired doing
myRegion = Scene.GetRegionAt(actor.X,actor.Y);
myEnt.StickToRegion(myRegion) 
it doesn't fully works, because if there is another 3d actor at the on the same

obviously just using the entity's X and Y doesn't work, because its coordinates is near the actor's head (i use the new wme 1.8.5 GetBonePosition2D() thank for that new function !)
But then the z-ordering is wrong because WME sets z-order for the actor by it's feet's position.

I didn't see any any functions that can help me on the 3dactor.

Any suggestions how to do it ?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: z-order coding question
« Reply #1 on: April 03, 2008, 11:12:58 AM »

How about moving the hotspot of the 2D thingy, so that it's base point is at the character's feet?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile
Re: z-order coding question
« Reply #2 on: April 03, 2008, 04:42:31 PM »

Allright, how should i do it ?
Is there any way to set the sprite's hotspot on from the script ?

Each Actor has a diffrent height to begin with, and moreover, in different scenes, with differert the same actor has a different hight.
I know to get the head bone and the feet bone's position allright, but how do i set the sprite's hotspot to the feet and place the sprite itself on the head ?

Oded
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: z-order coding question
« Reply #3 on: April 03, 2008, 04:54:55 PM »

Is there any way to set the sprite's hotspot on from the script ?
Yes.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.036 seconds with 23 queries.