Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Problem with code: var actObj = Game.ActiveObject;  (Read 2960 times)

0 Members and 1 Guest are viewing this topic.

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Problem with code: var actObj = Game.ActiveObject;
« on: September 15, 2009, 05:20:13 PM »

I have an object bench with holes between slats.
The program changes the form of cursor depending on a hit between slats.
How to do that a code:

var actObj = Game.ActiveObject;

was returned by an object bench, even if a cursor will be between slats?

I draw between slats a color with alpha. But alpha for png file necessary to do more than 50%.
And it does not apply.

How to do that places was not it visible between slats, but a code:

var actObj = Game.ActiveObject;

in these places worked as on an object?
« Last Edit: September 15, 2009, 05:22:16 PM by Lion »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with code: var actObj = Game.ActiveObject;
« Reply #1 on: September 15, 2009, 07:55:06 PM »

You have two options. Either create a sprite for your bench image, and uncheck the "pixel precise" check-box in SpriteEdit. Then the entire rectangle of the image will become interactive.
The other way is creating a region entity on top of your graphics, and edit the region into a shape which approximately covers the bench.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: Problem with code: var actObj = Game.ActiveObject;
« Reply #2 on: September 16, 2009, 09:05:47 AM »

Thanks!

Is it possible to reduce the operation threshold (png file):

var actObj = Game.ActiveObject;

on alpha to 1%?
« Last Edit: September 16, 2009, 09:07:19 AM by Lion »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with code: var actObj = Game.ActiveObject;
« Reply #3 on: September 16, 2009, 09:14:31 AM »

No, everything with more than 50% transparency is considered totally transparent and such pixels are ignored when picking active object.
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.