Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Dynamically Create Region  (Read 2270 times)

0 Members and 1 Guest are viewing this topic.

serdar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • View Profile
    • serdar
Dynamically Create Region
« on: September 01, 2010, 02:32:31 PM »

hi,

I have asked a question before about this topic on forum.
http://forum.dead-code.org/index.php?topic=4426

but i have a different problem now. I created the regions dynamically but some places in my region are not catching mouse...

Am I setting wrong points...


You can download sample project here
serdarb.com/RegionProblem.zip

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Dynamically Create Region
« Reply #1 on: September 01, 2010, 02:49:26 PM »

The order of the points matters. This way you created kind of twisted regions, not rectangles (try painting the points on paper and connect them with lines).

This should work as expected (notice the points are added in clockwise order):

Code: WME Script
  1. zLeftRegion.AddPoint(0, 0);
  2. zLeftRegion.AddPoint(170,0);
  3. zLeftRegion.AddPoint(170, Scene.Height);
  4. zLeftRegion.AddPoint(0, Scene.Height);
  5.  


Code: WME Script
  1. zRightRegion.AddPoint(1100, 0);
  2. zRightRegion.AddPoint(1280,0);
  3. zRightRegion.AddPoint(1280, Scene.Height);
  4. zRightRegion.AddPoint(1100, Scene.Height);
  5.  
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.058 seconds with 25 queries.