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: MouseEntry seems to not work with AddEntity  (Read 3079 times)

0 Members and 1 Guest are viewing this topic.

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
MouseEntry seems to not work with AddEntity
« on: September 23, 2015, 03:51:35 PM »

Hey,

I am trying to make some dinamic enities, but when I load them the dont recieve mouse interections.
They apear on scene but dont have any mouse imputs, Please help.

Code:
global MoveLayer = Scene.InsertLayer(4,"move");
   
      var locx = actor.X - 80;
      var locy = actor.Y - 40;
      var num = 0;
      
   var i;
   for(i = 0; i < (ACpoints/3); i = i + 1)
        { 

      var tile = MoveLayer.AddEntity("movepoint");
      
      num = num + 2;

      locx = locx + 85;
      locy = locy + 45;
      
      tile.SetSprite("interface\Battle\move"+num+".png");
      tile.AttachScript ("scripts\myMoveTile2.script");
      tile.X = locx;
      tile.Y = locy;
      tile.Active = true;
      tile.Interactive = true;


and this is attached script:
on "MouseEntry"
{
this.SetSprite("interface\Battle\move4-hover.sprite");
}
on "MouseLeave"
{
this.SetSprite("interface\Battle\move4.sprite");
}
Logged

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
Re: MouseEntry seems to not work with AddEntity
« Reply #1 on: September 24, 2015, 08:42:43 AM »

OK,

I found problem, it was because PNG was with some transparency.
Added it to sprite without  pixel precise and now it works at should.
Logged
 

Page created in 0.1 seconds with 23 queries.