Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:54:37+00:00 2026-06-01T21:54:37+00:00

in PlayN, if I have a root layer scaled (eg, scale of 2.0), when

  • 0

in PlayN, if I have a root layer scaled (eg, scale of 2.0), when I detect a mouse point on screen, 10,10 and draw it point on screen, the point shown is twice the distance as I saw on the OS’s mouse point.

What I want is the object I drag move at the exact same distance as I move my OS mouse pointer.

Is there a coordinate map function that map my mouse input X/Y to my logical scaled coordinate system?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:54:39+00:00Added an answer on June 1, 2026 at 9:54 pm

    You have two choices. You can register your Pointer.Listener on the root layer and use Pointer.Event.localX/Y to obtain the mouse coordinate in the layer’s coordinate system:

    graphics().rootLayer().addListener(new Pointer.Adapter() {
        public void onPointerStart(Pointer.Event event) {
            // use event.localX() and event.localY() here
        }
    });
    

    Or you can register a global Pointer.Listener and use Layer.Util to translate the points manually:

    pointer().addListener(new Pointer.Adapter() {
        public void onPointerStart(Pointer.Event event) {
            Point local = Layer.Util.screenToLayer(graphics().rootLayer(), event.x(), event.y());
            // use local.x and local.y here
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a play appliaction that works if It is the root of the
Imagine you have a PlayN game which uses Guice bindings in its core project:
I have a Python server which is not running as root, which fronts an
I have an app with a tab bar controller at the root. The home
I have authored a mojo that generates code and sticks it under {root}/target/generated-sources/foo .
i have the following data root root/blue root/blue/temp root/main root/main/dev root/main/back root/etc/init root/etc/init/dev root/etc/init/test
I have a series of MCs in my root timeline. On each frame in
I have a file, which is in XML format (consists just of root start
I have some XML thus <root> <TemplateNode> <Heading> <ID>1</ID> <Name>HeadingNodeTest</Name> <Order>1</Order> <Text>This is a
I have a root view and a detail view, in the detail view is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.