Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Munchor

Pages: 1 ... 91 92 [93] 94 95 ... 424
1381
Axe / Re: Axe Q&A
« on: May 24, 2011, 04:29:34 pm »
It'll keep doing that so long as you have that RecallPic in there. What's the RecallPic for, anyway?

To Recall the image I drew before the loop, I know it's not needed in this particular case, but I'll need it later.

1382
TI Z80 / Re: The Chosen Magic Method?
« on: May 24, 2011, 04:27:57 pm »
It's a tie! Which one will you choose?

1383
TI Z80 / Re: Fritzing on calc
« on: May 24, 2011, 04:27:37 pm »
Is that like Logisism? Cool!

1384
TI Z80 / Re: Contest entry - Continuity
« on: May 24, 2011, 04:24:35 pm »
I dont know if there will be a level editor. Most likely.

That's really neat (if there is one) :D

1385
Axe / Re: Axe Q&A
« on: May 24, 2011, 04:10:32 pm »
Does it display as grey initially?

Yes for a bit of a second.

1386
Axe / Re: Axe Q&A
« on: May 24, 2011, 02:59:16 pm »
Well, what's going on is that StorePic and RecallPic make L3 and L6 the same, so it's still greyscale, but all the greyscale routine sees is black pixels and white pixels. Remove the RecallPic or draw some more on the back buffer to fix it.

I have tried drawing in the back buffer right before DispGraph (not just in the stored pic) but it changes quickly to black :S

1387
TI Z80 / Re: Contest entry - Continuity
« on: May 24, 2011, 02:46:35 pm »
Will there be a level editor? This is looking greater and greater, nice job aeTIos.

1388
Computer Programming / [Java] Key Events and Multiple Classes
« on: May 24, 2011, 08:13:35 am »
I have two files:

Squared.java
Code: [Select]
import javax.swing.*;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;

public class Squared {
JFrame mainFrame = new JFrame("Squared");
public int x = 5;
public int y = 5;
public boolean canRunConstructor = true;

public static void main (String[] args)
{
Squared mySquared = new Squared();
mySquared.Draw();
}
public Squared()
{
// TODO Constructors
}
public void Draw()
{
canRunConstructor = false;
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setSize(480,320);
mainFrame.getContentPane().setLayout(null);
KeyEvents keyEvents = new KeyEvents();
mainFrame.addKeyListener(keyEvents);

BufferedImage img = null;
try {
img = ImageIO.read(new File("bin/block.png"));
} catch (IOException e) {
e.printStackTrace();
}
JLabel picLabel = new JLabel(new ImageIcon( img ));
picLabel.setBounds(x,y,40,40);

mainFrame.add(picLabel);

mainFrame.setVisible(true);
}
}

KeyEvents.java
Code: [Select]
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;


public class KeyEvents implements KeyListener {

@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == 39) //Right key
{
Squared mySquared = new Squared();
mySquared.x = mySquared.x + 5;
mySquared.mainFrame.repaint();
}
System.out.println(e.getKeyCode());
}

@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub

}

@Override
public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub

}

}

What i'm trying to do is when I press <RIGHT> in the keyboard, the block moves right, any idea what's wrong? I can't detailedly explain my code now.

1389
Axe / Re: Axe Q&A
« on: May 24, 2011, 07:15:52 am »
Is the second Rect() supposed to be a RectI()? And that Rect()r gets overwritten by the StorePic anyway.
The reason that It's going black is because immediately after you display the greyscale, you copy the back buffer to the front buffer, rendering the second frame b/w because the contents of the front buffer match the back buffer, so it's either 00 or 11 for every single pixel

1. The secodn Rect is indeed RectI.
2. Ah I see so when we Store or RecallPics we can't use greyscale or is there a way around? Thanks.

1390
Computer Programming / Re: Java Accessing Image Problem
« on: May 24, 2011, 02:52:35 am »
file:/home/david/Documents/Java/Squared/bin/block.png

Thanks a lot Graphmastur and Binder News. I get now, the image has to be in the folder where the class file is, thanks :)

1391
Computer Programming / Java Accessing Image Problem
« on: May 23, 2011, 04:48:42 pm »
Code: [Select]
import javax.swing.*;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;

public class Squared {
public static void main (String[] args)
{
Squared mySquared = new Squared();
}
public Squared()
{
Draw();
}
public void Draw()
{
JFrame mainFrame = new JFrame("Squared");
mainFrame.setSize(480,320);


BufferedImage img = null;
try {
img = ImageIO.read(new File("block.png"));
} catch (IOException e) {
e.printStackTrace();
}

JLabel picLabel = new JLabel(new ImageIcon( img ));
mainFrame.add(picLabel);

mainFrame.setVisible(true);
}
}

I have file named "Squared.java" and an image called "block.png" in the same folder and in the same package (using Eclipse); I get this:

Code: [Select]
javax.imageio.IIOException: Can't read input file!
Why can't it get the file, it's in the same directory. Thanks :)

1392
News / Re: Post Notifier
« on: May 23, 2011, 04:09:00 pm »
I was wondering, has anyone made a similar thing for Linux?

1393
Axe / Re: Axe Q&A
« on: May 23, 2011, 04:07:37 pm »
http://pastebin.com/L2Y2gg5F

Why can't I display greyscale (the Rect(^r)) in that code? The supposedly grey blocks appear as grey and a milisecond after change to black forever.

1394
Axe / Re: Axe Q&A
« on: May 23, 2011, 01:50:20 pm »
Can I use Lists (no, not arrays) the same way in Axe as in Basic or I need to use Arrays? Thanks

1395
Axe / Re: Physics Introduction Axe Tutorial
« on: May 23, 2011, 08:54:22 am »
Another great tutorial for people to start experimenting :D

Minor correction: "Irrealistic" should be "Unrealistic" ;D

XD Thanks my English still has a flaw or two :P

Pages: 1 ... 91 92 [93] 94 95 ... 424