Page 1 of 1
					
				layer position
				Posted: Sun Sep 12, 2021 7:18 am
				by davoodice2
				hi friends. how to get later position? and how to set layer position?
			 
			
					
				Re: layer position
				Posted: Sun Sep 12, 2021 7:39 am
				by synthsin75
				moho.layer.fTranslation:GetValue(frame)
moho.layer.fTranslation:SetValue(frame, LM_Vector3)
			 
			
					
				Re: layer position
				Posted: Sun Sep 12, 2021 10:23 pm
				by davoodice2
				synthsin75 wrote: ↑Sun Sep 12, 2021 7:39 am
moho.layer.fTranslation:GetValue(frame)
moho.layer.fTranslation:SetValue(frame, LM_Vector3)
 
thanks wes.
 
			 
			
					
				Re: layer position
				Posted: Mon Sep 13, 2021 7:28 am
				by davoodice2
				synthsin75 wrote: ↑Sun Sep 12, 2021 7:39 am
moho.layer.fTranslation:GetValue(frame)
moho.layer.fTranslation:SetValue(frame, LM_Vector3)
 
is it posssible to get right corner of viewport coordinates ?
and how get mouse position in vector?
 
			 
			
					
				Re: layer position
				Posted: Mon Sep 13, 2021 9:54 am
				by synthsin75
				davoodice2 wrote: ↑Mon Sep 13, 2021 7:28 am
is it posssible to get right corner of viewport coordinates ?
and how get mouse position in vector?
 
The upper right corner is: moho.view:Width(), 0
The lower right corner is: moho.view:Width(), moho.view:Height()
2D layer mouse position is: mouseEvent.vec
 
			 
			
					
				Re: layer position
				Posted: Mon Sep 13, 2021 12:29 pm
				by hayasidist
				synthsin75 wrote: ↑Mon Sep 13, 2021 9:54 am
davoodice2 wrote: ↑Mon Sep 13, 2021 7:28 am
is it posssible to get right corner of viewport coordinates ?
and how get mouse position in vector?
 
The upper right corner is: moho.view:Width(), 0
The lower right corner is: moho.view:Width(), moho.view:Height()
2D layer mouse position is: mouseEvent.vec
 
just for clarity:
view:Height() etc is pixels in the Screen coordinate system (LM_Point)
mouseEvent.pt is also in the Screen coordinate system
mouseEvent.vec is the World coordinate system (LM_Vector2)
Conversion between the systems depends on the transforms such as layer translation, camera zoom etc etc but can be effected using 
LM_Graphics:ScreenToWorld and LM_Graphics:WorldToScreen
 
			 
			
					
				Re: layer position
				Posted: Mon Sep 13, 2021 11:18 pm
				by davoodice2
				Thank you very much .I  continue to learn with your helps