• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"Simpler" Graphics

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic