• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

ARCHIGAMER

[java] background color

9 posts in this topic

I am having some trouble having my applet background color staying black can someone help me? it stays black for about 3 secs then it goes grey. import java.awt.*; import java.applet.*; import javax.swing.*; public class test extends JApplet { public void init() { setBackground(Color.black); } public void paint(Graphics screen) { super.paint(screen); Graphics2D screen2D = (Graphics2D) screen; } }
0

Share this post


Link to post
Share on other sites
How about just drawing a filled rect the size of the applet and the color of your background? If your applet has animation you''ll have to erase the previous frame anyway.

=============================
silly programmer vb is for kids.
=============================
www.thejpsystem.com
0

Share this post


Link to post
Share on other sites
I well have the applet up later today I am at my brothers right now...not at my home comp. Well I supose I could draw a rectangle but it should stay the same background color as the examples in my book say it should.
0

Share this post


Link to post
Share on other sites
That is strange. It should stay black. I think that you might want to look into using a black rectangle the size of the applet like loserkid mentioned. This is handy especially if you start doing double buffering.

Adam

0

Share this post


Link to post
Share on other sites
It is because you are overriding paint and doing nothing with it. JApplet is a Container, so calling its paint method does nothing but paint it's children. Get rid of the super.paint(Graphics) and replace it with Graphics.clearRect(x,y,h,w);

Whoa i see a problem here. I know now that your original problem was a real one, archigamer. I just made a simple applet to prove my point to myself, and when i substituted JApplet for Applet I got the same behavior as you. The Applet behaves correctly with no overridden paint method or a call to super.paint in it's paint method, but the JApplet requires a clearRect(x,y,h,w) call in it's paint method to do anything.

Edited by - Jim_Ross on September 7, 2000 10:28:01 AM
0

Share this post


Link to post
Share on other sites
i dont understnad what you are saying...very well. anyways if it try the method the compiler spits out
"Background.java:13: non-static method clearRect(int,int,int,int) cannot be referenced from a static context
Graphics.clearRect(500,300,500,300);
^
1 error"

I am not to sure about the xy coords its asking for i dont see why it needs to info or what i need to put in for it. i tried clearRect without the "Graphics." doesnt compile heres the code if you still think you can help.

import javax.swing.*;
import java.awt.*;

public class Background extends JApplet
{
public void init()
{
setBackground(Color.black);
}

public void paint (Graphics screen)
{
Graphics.clearRect(500,300,500,300);
Graphics2D screen2D = (Graphics2D) screen;
}
}
0

Share this post


Link to post
Share on other sites