Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Correct coordinate calculating  (Read 2608 times)

0 Members and 1 Guest are viewing this topic.

Unmasked

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Correct coordinate calculating
« on: February 14, 2006, 09:57:15 PM »

On event Left click I apply actor.GoTo(Scene.MouseX, Scene.MouseY), it's standart way. But there is a problem.

Actor's walk sprite consist of graphic files with width_X and height_Y size. Engine associate actor with left top of graphic file. How I can associate actor with center of graphic file? So solution is actor.GoTo(Scene.MouseX+width_X/2, Scene.MouseY+height_Y/2). But problem is in scaling, which use in scene (0%, 10%, 50% etc.). How I can change actor.GoTo command to solve problem?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Correct coordinate calculating
« Reply #1 on: February 14, 2006, 10:03:27 PM »

You can define the "base point" of any sprite by setting the "Hot spot" in SpriteEdit. Typically you place the hotspot to character's feet to make it feel natural. Open some of the sprites of the default Molly actor in WME demo in SpriteEdit and you'll see where the hotspot is placed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Unmasked

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Correct coordinate calculating
« Reply #2 on: February 14, 2006, 10:47:08 PM »

Thanks
Logged
 

Page created in 0.052 seconds with 24 queries.