It is currently Tue Aug 05, 2025 2:30 am

All times are UTC - 5 hours



Forum rules


1.) No trolling. If you cant have fun without being a jerk to others, find some other forum to QQ
2.) No inappropriate/vulgar/sexually explicit posting. Staff reserves the right to deem anything they see fit as inappropriate.
3.) Have fun and don't post anything not geared at having fun!
4.) Please respect staff members and their decisions at all times. If you cannot accept a staff or moderator decision, please appeal to admin Seth.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Game help?
PostPosted: Sun Mar 25, 2012 7:39 pm 
Maintenance & PR Team
Maintenance & PR Team
User avatar
 Profile

Joined: Wed May 26, 2010 8:09 pm
Posts: 1895
Location: Look behind you. Theres a shadow. Look at where it is. It isnt me
Gender: male
Hey, so im making a game in java, and im getting errors. Anyone mind helping? :P

Im trying to add images to a full screen.
Spoiler:
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JFrame;

public class images extends JFrame {
public static void main(String[] args) {

DisplayMode dm = new DisplayMode(800, 600, 16,
DisplayMode.REFRESH_RATE_UNKNOWN);
images b = new images();
b.run(dm);

}
private Screen s;
private Image bg;
private Image pic;
private boolean loaded;
//run method
public void run(DisplayMode dm) {
setBackground(Color.BLACK);
setForeground(Color.WHITE);
setFont(new Font("Arial", Font.PLAIN, 24));
loaded = false;
s = new Screen();
try{
s.setFullScreen(dm, this);
loadpic ();
try{
Thread.sleep(5000);
}catch(Exception ex){}
}finally{
s.restoreScreen();
}
}
//loads pastures
public void loadpic(){
bg = new ImageIcon("C:\\back.png").getImage();
pic = new ImageIcon("C:\\pic.png").getImage();
loaded = true;
repaint();

}
public void paint(Graphics g) {
if(g instanceof Graphics2D){
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
if(loaded){
g.drawImage(bg, 0, 0, null);
g.drawImage(pic, 170,180, null);
}
}
}

_________________
Retired AANC Mentor | Retired MT Member | CMoTM | SoTM
IGN(s) : Maxattack, MAXS

Retired player, trying to come back again.


Top
 

 Post subject: Re: Game help?
PostPosted: Mon Mar 26, 2012 4:03 am 
Senior Moderator
Senior Moderator
User avatar
 WWW  YIM  Profile

Joined: Thu Jun 30, 2011 2:48 am
Posts: 7985
Location: Fuyuki City
Gender: male
is this the programmers era in BD Forum or wat?

anyway, tell us wat is the error :|

_________________
Image


Top
 

 Post subject: Re: Game help?
PostPosted: Mon Mar 26, 2012 8:49 am 
Major
Major
User avatar
 WWW  Profile

Joined: Wed Jul 28, 2010 5:38 am
Posts: 2954
Location: Broome, Western Australia
Gender: male
'Developers' Corner' Sub-forum in order owat??

_________________
Retired Head Mod

Image

Most Crystals: 121
Highest Power: 212


Sensual bath time feat. Ferr3t
Spoiler:
Image


Top
 

 Post subject: Re: Game help?
PostPosted: Mon Mar 26, 2012 11:44 am 
Major
Major
User avatar
 Profile

Joined: Sat Dec 19, 2009 7:48 pm
Posts: 2691
Gender: male
Ferr3t wrote:
'Developers' Corner' Sub-forum in order owat??


Maybe just a topic xD

_________________
Image

Image


Top
 

 Post subject: Re: Game help?
PostPosted: Mon Mar 26, 2012 5:49 pm 
Maintenance & PR Team
Maintenance & PR Team
User avatar
 Profile

Joined: Wed May 26, 2010 8:09 pm
Posts: 1895
Location: Look behind you. Theres a shadow. Look at where it is. It isnt me
Gender: male
aister wrote:
is this the programmers era in BD Forum or wat?

anyway, tell us wat is the error :|


Thats the thing, it just.. doesnt work. Eclipse doesnt give it to me, its just when i run it.

Jake wrote:
Ferr3t wrote:
'Developers' Corner' Sub-forum in order owat??


Maybe just a topic xD


Didnt know who to ask :P

Ronelm said the double try{ could be it, but i learned to have that, as well as the repaint.

_________________
Retired AANC Mentor | Retired MT Member | CMoTM | SoTM
IGN(s) : Maxattack, MAXS

Retired player, trying to come back again.


Top
 

 Post subject: Re: Game help?
PostPosted: Mon Mar 26, 2012 5:52 pm 
Senior Moderator
Senior Moderator
User avatar
 WWW  YIM  Profile

Joined: Thu Jun 30, 2011 2:48 am
Posts: 7985
Location: Fuyuki City
Gender: male
maybe u remember it wrong, or took note wrong? Idk, I know nothing about java, but if ron said it is then it's worth the try...

_________________
Image


Top
 

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Copyright Tacticsoft Ltd. 2008   
Updated By phpBBservice.nl