Avatar of James Hancock
James Hancock
Flag for United States of America asked on

Plz Help me translate this JFrame to Python

Hi, I Am a Python NEWBIE

Does anyone have time to plz show me what this kind of Java JFrame + capability looks like in Python?

This will all be for intended use in a game. Is PyGame more suited to this? Why or why not?
What can PyGame do in this situation?

Thanks

class gameWindow extends JFrame implements MouseListener, KeyListener {

  public gameWindow(ClientNetworkEngine CNE, int x, int y) {
            localCNE = CNE;
            setSize...
            setTitle("Game Window");
            ExternalGameLoopThread eglt = new ExternalGameLoopThread(this);
            setLocation(x,y);
            setVisible(true);
            addMouseListener(this);
            addKeyListener(this);
            eglt.start();
            
  }
       public mousePressed(MouseEvent m) {
           System.out.println("mouse pressed at : "+m.getX()+" , "+m.getY());
       }
       public  keyPressed(KeyEvent k ) {
           System.out.println("key pressed : "+k.getChar());
       }

}

Open in new window

JavaPythonProgrammingScripting Languages

Avatar of undefined
Last Comment
James Hancock

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mccarl

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
James Hancock

ASKER
I think PyGame looks perfect for my needs.
Do you think it will be decent speed / frame-rate for a fully functioning network RTS?
ie a Blizzard quality RTS. Full screen is a big plus. Will graphics at full screen be clunky?

This means I wont have to be mired in Direct X? Which compared to pygame looks tough.

Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23