Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Java Camera Navigation (no external Libraries)  (Read 618 times)
0 Members and 2 Guests are viewing this topic.
Offline lordberzerker97

JGO n00b
*

Posts: 34



« on: 2012-01-11 19:55:33 »

 Hello guys. I have a question. Does java have any form of 2D camera or at least something to navigate around the map? Also if you guys say that using the keyboard to move the environment around instead of the player, then please tell me how that is going to effect online play, will other players see the environment move around or will it just be one player?.
Offline ra4king

JGO Kernel
*****

Posts: 3155
Medals: 196


I'm the King!


« Reply #1 on: 2012-01-11 20:27:42 »

How about using Graphics2D.translate(double,double)?

Offline GabrielBailey74

Full Member
**

Posts: 157
Medals: 2


Owner of Elite Demons R.I.P


« Reply #2 on: 2012-01-11 20:29:13 »

How about using Graphics2D.translate(double,double)?

What exactly would that do?

Games published by our own members! Go get 'em!
Offline lordberzerker97

JGO n00b
*

Posts: 34



« Reply #3 on: 2012-01-11 20:54:33 »

THANK YOU!!! ME AND MY IMAGINARY PEOPLE BASK IN YOUR GLORY!!! THANK YOU THANK YOU THANK YOU!!!
Offline ra4king

JGO Kernel
*****

Posts: 3155
Medals: 196


I'm the King!


« Reply #4 on: 2012-01-11 22:37:36 »

@GabrielBailey74
Exactly as the JavaDoc explains, it translates every drawing by the specified inputs.

@lordberzerker97
Glad to help Grin

Offline ReBirth

JGO Wizard
****

Posts: 1275
Medals: 19



« Reply #5 on: 2012-01-11 23:57:16 »

@GabrielBailey74
offset modification Grin

Offline GabrielBailey74

Full Member
**

Posts: 157
Medals: 2


Owner of Elite Demons R.I.P


« Reply #6 on: 2012-01-12 00:09:20 »

Well, I tried that.
Added different floats, +, -.
I was thinking he meant like FULL rotation, where you could rotate it pretty much to a side view, from the left/right of the image.
Didn't work out for me like that. Sad
Just basicly took where ever i was drawing and moved it.

Before:
X-------X
-          -
-          -
X-------X

After:
   X-------X
   -          -
   -          -
   X-------X
I know it's his thread :$, but I was wondering if i could do something like that, or possibly create W,A,S,D/arrow key camera rotation.
OOooo

Offline ReBirth

JGO Wizard
****

Posts: 1275
Medals: 19



« Reply #7 on: 2012-01-12 00:12:21 »

Yeah it's called hijacking thread. In other forum this's crime and unforgivable. Dunno about here Grin j/k
If you draw everything on BI first, you can move camera by changing the x,y when drawing the BI. For example check my java4k entry, I used that for shake effect so you dont need translate.

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.094 seconds with 19 queries.