473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Using jpg or gif images for graphics in java game

Hi all.
I am creating a chess game and now I need draw pieces on board.
Creating every shape using GeneralPath and curves that are part of Graphics2D is difficult, especially when I draw a knight,because I must play endlessly with curves to see how they look.
So probably better decision is to create gif or jpg files that include images of pieces.
But images in files are square and I don't need to draw all the square ,I only need to draw particular shape (when player drags a piece over the board it would look disgustful if the piece is drawed like square and 'erases' something that it should not erase).How can I do this?

Advice and fresh ideas are appreciated!
Nov 14 '08 #1
2 2048
JosAH
11,448 Expert 8TB
Gif images can have transparent pixels; you don't have to visualize the entire
square of the image. Lots of image handling programs can handle transparent
pixels in .gif images.

see the attachment for an example of a .gif file with transparent pixels; it can
even display a 'moving' image.

kind regards,

Jos
Nov 14 '08 #2
thank you VERY much!
Nov 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jason | last post by:
Hi, I wish to create a little game where you drag pieces onto a board. I have been playing around with a picture box: Private Sub Picture1_DblClick() Picture1.Left = Picture1.Left + 50 End...
21
by: BlackHawke | last post by:
My name is Nick Soutter, I own a small game development company (www.aepoxgames.net) making our first game (www.andromedaonline.net) in java. I am writing because we are having a very...
6
by: Brian Basquille | last post by:
Hello all. Due to the short time remaining to my project handup for my Air Hockey game, i've abandoned the idea of implementing it over a network. But since the only real way to play Air...
3
by: Hitesh | last post by:
Hi, I am getting the response from another Website by using the HttpHandler in my current site. I am getting the page but all the images on that page are not appearing only placeholder are...
12
by: Xah Lee | last post by:
Of Interest: Introduction to 3D Graphics Programing http://xahlee.org/3d/index.html Currently, this introduction introduces you to the graphics format of Mathematica, and two Java Applet...
2
tpgames
by: tpgames | last post by:
Me memory game freezes after I click some cards. I seems to be random as to the number of clicks needed before it freezes. I posted the entire code, as I am not sure what is needed for help. I am...
11
tpgames
by: tpgames | last post by:
I've struck zero in finding a Link to a sudoku game that actually uses images for numbers, even images OF numbers. Yes, I'd prefer the game in JavaScript. Every site I've been too, (hundreds) uses...
2
by: vertozia | last post by:
Hey there, ive been having difficulty placing an image, this is my screenshot, and what ive done so far: http://img341.imageshack.us/img341/9894/gridwg2.jpg /** * ConnectFourGUI * Provide...
53
by: None | last post by:
Hi, I am a game developer, sometimes "indy" and sometimes for a small-sized company. I can't speak for all game developers, but everywhere I've ever seen people working on games, execution...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.