• Post Reply Bookmark Topic Watch Topic
  • New Topic

"Simpler" Graphics

 
Justin Fiedler
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey everyone, im working on a 2D graphical RPG. i have implemented an image class that stores an array of .gif's and returns the image corresponding to the current velocity and direction of the object. however this requires multiple images and i would much rather use a single image such as http://www.silentdream.co.uk/chara-evermore.png instead. does anyone know how to do this?
note: any advice on how to implement graphics is appreciated, even if it isnt about using a character set like the one shown above.

thank you,
justin
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are a couple of code examples that show how to create multiple images from one image file. It looks like both of these examples use "image strips" - which means that the image file only contains images in one direction, instead of in a block as in your example. However, it should be pretty easy to read the images from the block... just use a nested loop and increment height when reading the images.

http://www.cs.vu.nl/~eliens/documents/games/chap10/ExtractImageTest.java
http://www.rgagnon.com/javadetails/java-0239.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!