Android Trying to Make A Game Looking Like old school LCD Handheld

First off, sorry for the vague title, not sure what I should name it. And secondly, sorry if this is not the right section to post this issue as I'm not entirely sure if I should post under programming or game design. Anyway, I need help achieving this (as illustrated in the simple drawing) for Android.



Allow me to attempt explain what I hope to make;
  • A would be the game's "casing" or "skin" where the virtual game pads are and use to control the playable character in B. I intend it to be of 480px by 800px, with the black area in the image the "LCD" where B is displayed.
  • B would be the actual game room itself which I hope it'd be of 800px by 1280px.
  • Screen orientation will be fixed e.g. landscape & inverted landscape
Please teach me in as much detail as possible how to achieve this (will use GML) with end target is Android, I totally lack the skills needed. Thank you very much in advance.
 

Rob

Member
You could use 2 views. 1 for the game, another for the rest of it.

You'll need to make sure that you're only drawing the game stuff inside the game view.

Code:
//draw event of a game object

if (view_currrent == 0){
   //draw game only stuff
}
I think that's the main thing that you need to research really.
 
Last edited:
Thanks for responding, Rob.

Do you know of a source to learn how to achieve this? I've been reading the GML documentation about camera and view, but I can't find any hint to making the above possible. I know how to have the objects kept within a certain viewing boundaries if only made up of 1 room where the play area is very limited in size- like an old school LCD "game & watch" series. Unlike that, my objective is to make a large game room where only a limited portion of the game room is visible and centered to the playable object, and the game will be made up of several rooms, while giving the "feel" of playing on an emulator/handheld.

Edit:

NVM. I think I might have found how to do as per your suggestion after some trial and error. :)

Edit 2:

Seems like I stumble on an issue, apparently the larger room remain visible despite the viewport and camera been set to show only part of the room. Quite sure I'm missing something.
 
Last edited:

Rob

Member
Thanks for responding, Rob.

Do you know of a source to learn how to achieve this? I've been reading the GML documentation about camera and view, but I can't find any hint to making the above possible. I know how to have the objects kept within a certain viewing boundaries if only made up of 1 room where the play area is very limited in size- like an old school LCD "game & watch" series. Unlike that, my objective is to make a large game room where only a limited portion of the game room is visible and centered to the playable object, and the game will be made up of several rooms, while giving the "feel" of playing on an emulator/handheld.

Edit:

NVM. I think I might have found how to do as per your suggestion after some trial and error. :)

Edit 2:

Seems like I stumble on an issue, apparently the larger room remain visible despite the viewport and camera been set to show only part of the room. Quite sure I'm missing something.
If you still need some help on how to make a view be able to move around, here's a short tutorial:


You could make the GameBoy image be drawn first.
Then in your "Game" view make sure all your objects have their draw events only draw if they're inside the view.
You can then draw the buttons in the other view.

I might be spouting bs because I haven't attempted this myself, it's just the first thing I would try if I were in your shoes.

[EDIT] I went ahead and made a prototype so you can get the idea: https://www.dropbox.com/s/e43cjjhwms14dcd/gameboy.yyz?dl=0
 
Last edited:
Wow, thank you very much for going the distance to provide me with the sample. You're right, I am still having trouble figuring how to do this, bumped into so many issues. With this sample and video tutorial, it'd certainly help me understand how it's properly done better, given my lack of skills and knowledge. I have downloaded the file and gave it a quick run. That's exactly what I wish to achieve. I'll be learning a lot from your sample. :)
 

Rob

Member
Wow, thank you very much for going the distance to provide me with the sample. You're right, I am still having trouble figuring how to do this, bumped into so many issues. With this sample and video tutorial, it'd certainly help me understand how it's properly done better, given my lack of skills and knowledge. I have downloaded the file and gave it a quick run. That's exactly what I wish to achieve. I'll be learning a lot from your sample. :)
Glad I can help ;) I wanted to see if I was correct in what I was telling you lol
 
Hi SnortySnoopy,

This is exactly what I have achieved for my Android game that I'm currently working on still. While there might be different ways of going about doing this, I'll tell you how I've accomplished it and hope that it helps you out.

First off, I'm currently still using GMS1.4, but I'm sure you can change things to easily work with GMS2, if that's what you're using.
You need to decide on a width and height size that you want your A and B "boxes/rectangles" to be. Let's call A the "game skin" and B the "game window". You only need one view, which will be for your game window. For example, my game window is 176x160 and my game skin is 180x320 (old school retro styled pixel art game). My game is played using portrait mode and I use the game skin dimensions (180x320) to decide how much to scale my game to fit the screen of the phone. I use the Room Start even to disable the Application Surface and then resize it to be the width and height of my game window (176x160) and resize the GUI layer to be the size of my game skin (180x320) by using the display_set_gui_maximise function. I then use the Post Draw event to redraw the Application Surface.

Anything that I want placed on the game skin, like sprites or text for the game buttons, I draw in the Draw GUI event and anything that I want displayed in the actual game itself or inside the game window area, I draw in the regular Draw event using if view_current == 0 {*draw all your stuff here*}. I use the Pre Draw event to draw my game skin background. You can even make sure there never is any "black bars" if you so desire too.
 
@ Gold Mammoth,

Thank you for the suggestions and sharing how you did it. I'll be sure to remember, and it'd surely be useful as I progress in my attempt in making this project. But yes, I am using GMS2 for Mobile and Desktop. :)
 
D

dannyjenn

Guest
I'm making a Super Game Boy style game, and my approach is quite different. Instead of using views, I am drawing everything to a surface and then calling surface_draw_part_ext() to draw the desired portion of that surface to the application surface, scaled if necessary. Afterwards I draw the "skin" (Super Game Boy styled border) to the application surface over the other stuff (the "window" region is fully transparent).

I'm not sure how my way compares with views in regard to efficiency, but it seems to be working fine so far. (Takes a little more work setting it up though... all instances are set to visible = false; and everything is drawn from a single controller object)
 
Ah ok, so there are alternative approaches to achieving this idea. Noted. Thank you for sharing your approach @ Dannyjenn.
I've to do a few things before I can begin checking if what I did is off and need fixing. Especially in regard to objects that will be projected through viewport1.
 

Rob

Member
Ah ok, so there are alternative approaches to achieving this idea. Noted. Thank you for sharing your approach @ Dannyjenn.
I've to do a few things before I can begin checking if what I did is off and need fixing. Especially in regard to objects that will be projected through viewport1.
Yeah there are plenty of ways to do it so whichever one seems more logical to you would be best I'm sure ;)
 
Yeah there are plenty of ways to do it so whichever one seems more logical to you would be best I'm sure ;)
Yup. For now I went with your method, partly because I don't know yet how to make use of "surface". I also finally figured out how to make the buttons show up on top of the "skin" without causing it to show up in viewport1 - took me awhile to get it right (I hope). I still have a long way to go with this project, no doubt there'll be more obstacles along the way. :)
 

Rob

Member
Yup. For now I went with your method, partly because I don't know yet how to make use of "surface". I also finally figured out how to make the buttons show up on top of the "skin" without causing it to show up in viewport1 - took me awhile to get it right (I hope). I still have a long way to go with this project, no doubt there'll be more obstacles along the way. :)
It never ends ;)
 
Top