12
Cyanite
7y

I know this really isn't the place for this, but I REALLY need help..

I need to add app scaling inside my game.

To do this, I need to listen for a MouseDragEvent (or similar) on a JavaFX object like a Label or Image.

Here is my SO post:
http://stackoverflow.com/questions/...
Thanks in advance!

Comments
  • 6
    This is the next step of devRant
  • 12
    @shozukan
    If devRant adds a gentle community where anyone can ask dev questions without the strictness of SO, devRant will own the game.
  • 1
    @Cyanite make a new menu or tag for questions related
  • 3
    @shozukan
    Maybe a new tab like the Stories tab.
  • 2
    Set small invisible buttons in the corners, save the xy position on click, save xy on release and resize the panel based on the distance between the two points.
  • 3
    @Cyanite "quetions" tab might be appropriate ;)
    But it would be a good idea, this is the most friendly community I've seen

    I can't help you with your problem unfortunately, not enough knowledge to say anything, not enough time to search for a solution, sorry
  • 3
    @RazorSh4rk
    I dont need an invisable dutton. I can add an event trigger onto a label. And that wouldn't work because the dragging effect wouldn't hold. It would only resize the window after you released the mouse.
  • 2
    It would be fantastic if there is a stories tab
  • 0
    @Cyanite maybe after starting to drag, update the size of the window every few ticks
    If that makes sense
  • 3
    @Mitiko
    You didn't know about that?
  • 1
    @Cyanite I mean it should be more snapchat-tish
  • 0
    @g-m-f why downvote?
  • 2
    @Mitiko
    Never used it.
  • 1
    @g-m-f oh! I'm kinda new here, didn't knew about that
  • 3
    @g-m-f I got a 2 years ban cause of that. I know the pain
  • 3
    @shozukan
    I just had to make a new account because of a ban.
  • 1
    @Cyanite idk if i get your question but i would recommend that

    Use a Dimension variable that stores your default sizes.
    use: addActionListener on the object that will change its size and increment the dimension variable, then setSize(dimension) on that object.

    btn.AddActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    //here u can check event type e
    //ex check if its a click, hover..
    //modify dimension values
    node.setSize(dimension)
    //use setSize
    }
    });
  • 0
    @Cyanite but thanks to that I found the chat rooms
  • 1
    @0x41414141
    Think you could walk me through this on Telegram @TheCyaniteProject? I'm pretty new to Java.
  • 1
    @Cyanite
    I can give you the project I made in university that i looked over before answering to your question.
    It doesn't have the code to your needs but has some windows and actionlisteners and set of sizes.
    I used my last brain connections to write that answer.
    It's 9 PM here in Romania and i am exhausted after work and master courses, just want to chill with a beer and watch some dota.
  • 1
    @0x41414141
    I don't believe your answer is for javafx. I can't find the event listener imports
  • 4
    We'll probably add a Q&A section soon, though it'll be more opinion based questions like Quora than SO as the super technical nature of SO lends itself to people being sticklers for the details and newer devs asking basic questions because they are too lazy/entitled to do a search first, all that can bring out the worse in people fighting to be "right"
Add Comment