Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Game with simple GUI  RSS feed

 
Greenhorn
Posts: 10
  • 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: 5235
143
  • 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
 
H. Mungus
Greenhorn
Posts: 10
  • 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!
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!