Browsing this Thread:
1 Anonymous Users
|
Re: How detect transparent part of sprite
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Beware that next release of PortablE renames "UsageCount" to "VisibleCount" for method names.
Posted on: 2014/5/24 11:35
|
|||
|
||||
|
Re: How detect transparent part of sprite
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
I never thought anyone would want to do that, so I didn't add that option (and I don't think it is a common enough need to justify adding it).
But it MAY be possible to 'trick' PortablE's sprite system into thinking it is not transparent, by creating & using a cGfxDrawable subclass which is really just a cGfxBitmap: http://cshandley.co.uk/portable/StandardFunctionality.html#20_7 I'll try to see if I can do it.
Posted on: 2013/12/24 9:19
|
|||
|
||||
|
Re: How detect transparent part of sprite
|
||||
|---|---|---|---|---|
|
Just can't stay away
![]() |
I also think that only hope is tracking sprite position and compare it with mouse coordinate, but is not as easy as click on it.
Posted on: 2013/12/24 5:43
|
|||
|
||||
|
Re: How detect transparent part of sprite
|
||||
|---|---|---|---|---|
|
Quite a regular
![]() |
For this you can just check if the mouse clicked in the rectangular bounds of the sprite.
You will have to loop through each sprite to find the one that is closest to the mouse click. This will be easy if the sprites are the same size.
Posted on: 2013/12/24 2:21
|
|||
|
||||
|
How detect transparent part of sprite
|
||||
|---|---|---|---|---|
|
Just can't stay away
![]() |
I start my new game. My sprites has some transparent area. I need draw that sprites with transparency, but I must detect clicks on all sprite area, even if user click on transparent part. So how draw sprites as transparent but detect all sprite area?
My typical code is simple: CASE EVENT_MOUSE_LEFT, EVENT_MOUSE_DOUBLECLICK IF FindSpriteAt(value,value2)<>NIL THEN i := LastSprite().getData() -> action code for detected sprite ENDIF
Posted on: 2013/12/23 16:11
|
|||
|
||||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.







