[16 May 2010] LayerID?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
Tarzin
Posts: 112
Joined: Mon Feb 15, 2010 11:46 am
Location: Dunkerque / FRANCE
Contact:

[16 May 2010] LayerID?

Post by Tarzin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 16 May 2010 18:40:09 +0200

Hello,

I've set many brushes on a windows but don't know which is layer number attribued to a brush. Is it possible to add some code which displays LayerID when moving over a brush, or a text (text displayed with textout)?

Thanks a lot for advance.

Tarzin
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

[16 May 2010] Re: LayerID?

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 16 May 2010 20:05:31 -0000

Will GetLayerAtPos()---a new 4.7 function---do what you want?
User avatar
Tarzin
Posts: 112
Joined: Mon Feb 15, 2010 11:46 am
Location: Dunkerque / FRANCE
Contact:

[17 May 2010] Re: Re: LayerID?

Post by Tarzin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 17 May 2010 20:32:36 +0200

Hello rev, :
Will GetLayerAtPos()---a new 4.7 function---do what you want?
Yes, seems to be the right functon.

I've tried this code without success

Code: Select all

; Function p_displayLAYERID
;
Function p_displayLAYERID(msg)
Switch (msg.action)
Case "OnMouseMove":
     numid=GetLayerAtPos (msg.x,msg.y)
     DebugPrint (msg.x,msg.y,numid)
EndSwitch
EndFunction

InstallEventHandler({OnMouseMove = p_afficheLAYERID})

Repeat
WaitEvent
Forever
Any idea what's wrong?

Another think: Is debugprint function working without compilation?

thanks!

Eric/Tarzin
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

[17 May 2010] Re: LayerID?

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 17 May 2010 19:50:44 -0000

p_afficheLAYERID does not match up with p_displayLAYERID
User avatar
Tarzin
Posts: 112
Joined: Mon Feb 15, 2010 11:46 am
Location: Dunkerque / FRANCE
Contact:

[18 May 2010] Re: Re: LayerID?

Post by Tarzin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 18 May 2010 07:12:29 +0200

no, that's because I've translated my code from french to english but function's name is the same in both cases.
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

[18 May 2010] Re: LayerID?

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 18 May 2010 14:16:39 -0000

Well, try the following code:

Code: Select all

EnableLayers()

SetFillStyle(#FILLCOLOR)
Box(5, 5, 50, 50, #RED)
Box(55, 5, 50, 50, #BLUE)
Box(110, 5, 50, 50, #GREEN)

Function p_displayLAYERID(msg)
	Switch (msg.action)
		Case "OnMouseMove":
			numid=GetLayerAtPos (msg.x,msg.y)
			DebugPrint (msg.x,msg.y,numid)
		EndSwitch
EndFunction

InstallEventHandler({OnMouseMove=p_displayLAYERID})

Repeat
	WaitEvent
Forever
When your mouse is over the red box, the ID will be 1; when over the blue box, it will be 2; and when over the green box, it will be 3.
User avatar
Tarzin
Posts: 112
Joined: Mon Feb 15, 2010 11:46 am
Location: Dunkerque / FRANCE
Contact:

[18 May 2010] Re: Re: LayerID?

Post by Tarzin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 18 May 2010 19:14:25 +0200

rev, thx!

Your code is working and I found what was wrong! I sent you a sample of my code. Real code was

Code: Select all

; Function p_displayLAYERID
  
Function p_displayLAYERID(msg)
Switch (msg.action)
Case "OnMouseMove":
         numid=GetLayerAtPos (msg.x,msg.y)
         DebugPrint (msg.x,msg.y,numid)
EndSwitch
EndFunction

InstallEventHandler({OnKeyDown = p_majEnreg},{OnMouseMove=p_displayLAYERID})

Repeat
WaitEvent
Forever
This is not working but if you change the line

Code: Select all

InstallEventHandler({OnKeyDown = p_majEnreg},{OnMouseMove=p_displayLAYERID})

with

InstallEventHandler({OnKeyDown = p_majEnreg})
InstallEventHandler({OnMouseMove=p_displayLAYERID})
It works, strange no??

Eric
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
User avatar
Tarzin
Posts: 112
Joined: Mon Feb 15, 2010 11:46 am
Location: Dunkerque / FRANCE
Contact:

[18 May 2010] Re: Re: LayerID?

Post by Tarzin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 18 May 2010 19:20:16 +0200

pffff, what an idiot...

InstallEventHandler({OnKeyDown = p_majEnreg, OnMouseMove = p_displayLAYERID})

and all is working!

Eric
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
Locked