Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Game with simple GUI  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm thinking about porting a game that I wrote in (desktop) Java several years back to Android Java but I have a fundamental question about the graphics. This is NOT a first person shooter game or anything visually complex. In fact, it's basically Hangman with some twists. My GUI needs to show a mystery phrase broken into boxes with one letter per box. I need to be able to put special characters underneath each box to indicate if it is a vowel or special character. I want to show the letters and words which have already been guessed. I need something like buttons to indicate that the player gives up on the current phrase and wants to move on to another phrase. The player needs to be able to access settings so that they can turn on or off various features. I suppose something moderately interesting needs to happen visually to indicate a successful guess of a letter or of the whole phrase or failure to get the phrase after the maximum number of tries but that's not important to me: that could be as simple as displaying a message like "Congratulations!" or "Sorry, you lost".

Can I do all of this without having to resort to something like Unity? I started to look at Unity but found that it seemed to be geared towards much more visually complex games; I didn't see any capacity to do anything as simple as what I want to do.
 
Saloon Keeper
Posts: 5038
134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, I think a library such as Unity would be way overkill for your purposes. In Android you could subclass an android.view.View and use a Canvas to do custom drawing (which includes putting text on the canvas if need be).

A simple example: https://stackoverflow.com/questions/16605428/custom-view-canvas-ondraw-doesnt-draw-anything/16606144#16606144
 
Hugh Mungus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:Indeed, I think a library such as Unity would be way overkill for your purposes. In Android you could subclass an android.view.View and use a Canvas to do custom drawing (which includes putting text on the canvas if need be).

A simple example: https://stackoverflow.com/questions/16605428/custom-view-canvas-ondraw-doesnt-draw-anything/16606144#16606144



Thanks, Tim, I was hoping there'd be an easier way :-)

I'm also pleased that my question showed up this time! I used to post here occasionally in my Java ME days but hadn't been around in a few years. Then, when I tried a mobile post a few weeks back, I couldn't find my post after sending it, nor could I find any way to notify anyone to find out what I was doing wrong. It looks like the problem sorted itself out in the meantime.

Thanks again for your suggestion!
 
You've gotta fight it! Don't give in! Read this tiny ad:
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!