- Home /
Question by
oliver-jones · Dec 06, 2010 at 01:39 PM ·
javascripttranslatefun
Translate Into JavaScript Please
Hello, would appreciate if anyone could translate this from C# to JavaScript please:
if( Event.current.type == EventType.MouseDown && PointIsWithinRect( Event.current.MousePosition, myDraggableObject.rect ) )
{
currentlyDragged = myDraggableObject;
}
else if( Event.current.type == EventType.MouseDrag && currentlyDragged != null )
{
currentlyDragged.rect = new Rect( currentlyDragged.rect.x + Event.current.mousePosition.x, currentlyDragged.rect.y + Event.current.mousePosition.y, currentlyDragged.rect.width, currentlyDragged.rect.height );
}
else if( Event.current.type == EventType.MouseUp )
{
currentlyDragged = null;
}
Comment
Best Answer
Answer by Mike 3 · Dec 06, 2010 at 01:41 PM
That should be the same in both languages
If you ROT26 the code, it will magically be translated into JS.
Your answer
Follow this Question
Related Questions
About "translating" js into C# 1 Answer
C# to java translation 2 Answers
java to C# conversion 1 Answer
Using .Translate() on one variable moves a different var, how? and how do i stop this? 1 Answer