Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Multiple Resolutions & Other Questions

Author
Message
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 28th May 2016 20:36
Hi Guys,

I am new here and also a new user of AppGameKit (on Steam). I am looking at starting to make a real estate application for iPhone & Android devices.

I have a few questions in regards to this.


Firstly what should I look in to for methods on how to support multiple screen sizes for my application. I should mention I am hoping to code this entire app using the Tier 1 basic language.

Also the application when loaded the user will be taken to a log in screen at first, there will be an option to sign up or sign in with an existing username. I am hoping that this is something that can be coded using Tier 1 basic language. I have a hosting and have already set up a MySQL data table ready to store the user information but I am not to sure where to start in with AppGameKit in regards to coding this and seeing it on my device. I have a working prototype of this in Android Studio but wanted to use AppGameKit instead as I feel I haven't really touched it since purchasing and want to see what it is capable off

Thanks!

Dave.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th May 2016 21:18
Welcome

Quote: "Firstly what should I look in to for methods on how to support multiple screen sizes for my application"

SetVirtualResolution is designed to make sure your app looks the same on all devices. Once set, you design for your virtual resolution and AppGameKit will resize it to suit all devices

The aspect ratio (width:height) may vary on devices. In this case you get black bars to compensate. You use SetScissor(0,0,0,0) to allow you app to bleed into the black bars. In this case, make your background larger than needed, but keep working within the virtual resolution.
If you want to use all of the screen for all devices, you can use getDeviceHeight() and getDeviceWidth() to get the full screen dimensions, and then do some jiggery-pokery on the positioning of entities in your code.

Quote: "the user will be taken to a log in screen at first, there will be an option to sign up or sign in with an existing username. I am hoping that this is something that can be coded using Tier 1 basic language"

Yes, you can use the HTTP commands and PHP to perform the login. Take a look at the threads about online high scores, which is essentially the same concept.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 29th May 2016 21:37
That's great man. Thanks for the help this defo sounds like a good start in the right direction. I am pretty excited to get started
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 30th May 2016 01:05
Duplicating the posts until you consolidate your questions...

HTTP commands are available in Tier 1 and Tier 2. Everything you see in the help files is available in both. I'm a T1 user myself, I love the speed that you can create things.

I just read your post again in more detail. Facebook has its own commands, but they can be a little bit awkward in terms of the limitations Facebook put on you. For example, I have a game that allows FB login. But I am in a catch-22, I can't interact with FB until I have an app, and I can't put FB functionality in the app until I am approved! So I have the login, and a dead-end.

Google+ isn't implemented as a command, I don't know what would be involved to get this working. But of course you can always call out to a browser page from your app, and use the HTTP commands.

There is a third way. You call a browser window and log in.using the APIs you can capture the login token on your website, and then use your website and HTTP as an intermediary between the app and the third-party site. I got this working in a prototype for a small TGC project.

Regarding the player, you can download it from the Play Store. Start it up, and then press F8 in the editor. If you are on the same network, your app will start up in the player. Yes, it really is that simple!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 30th May 2016 23:26
I am starting a wireframe for my app's UI and wanted to know rather than me using images/sprites for my UI is it possible to draw things to the screen in AppGameKit rather than me importing images from a program like Illustrator?

I checked the API and can't seem to find anything about drawing commands. Also wanted to know if I can draw text to the screen as well and how would the coordinate system work for placing these things on screen?

Can elements like text be parented in code to 2D objects. Say I have a box I've drawn on screen (if that is possible), could I parent some text to that box so the text will show within the box?

Sorry if these question seems a bit stupid or don't make sense. I really want to start a simple visual representation of my app to allow me to start writting the code for the functionality of the app.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st May 2016 09:03
No question is stupid, it's good that you are thinking about the different ways to do things.

Sprites are a much better way to manage your screen entities than drawing. The pipeline is optimised for this way of working.

You can actually draw to the screen (DrawBox() etc). But using these methods means you have to redraw every cycle. Sprites are persistent, once you have created and positioned them, they will remain until you move or delete them.

It is also possible to use the draw commands and then GetImage(). then you can CreateSprite() from the image and you have the best of both worlds. You would normally create the images at the start, because it is a slow command. Only milliseconds, but eats up a lot of your framerate when running at 60FPS.

Images are cheap in terms of file size these days, if that is your concern.

Text is best created using the CreateText() and related commands. It is generated from a bitmap atlas of the font. (There are free tools on the forum here to make your own). If you want to parent it to a button, then you could use the getImage() approach described earlier. This is exactly what I do It is worth creating a small routing that you pass the button, text and font into, and to returns a finalised image for you.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 31st May 2016 12:32
That sounds great!

I'll have to give all this a try and just export my wireframe in Illustrator as sprites rather than trying to recreate it with the DrawBox() command.

I purchased the AppGameKit Tutorial Guide, I'm currently reading through this trying out the exercises.

I'll post back here with any other questions, really enjoying AppGameKit at the moment, very straight forward program. It's makes coding very enjoyable and the ease of use when testing on a device is brilliant!
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 31st May 2016 14:43
Just posting back here with some more questions.

I have now started to sketch in Illustrator some UI elements to mess around with and practice how to properly place things and test it on my device. I was wondering how something like a sidebar menu would work. Similar to most apps now where you can swipe to the right or left of the screen to scroll in a sidebar menu. I was wondering how something like this would be handled in AppGameKit as I've never really tried anything like this.

Would parallax scrolling be something I would need to look in to?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st May 2016 15:38
You can detect when the mouse hits the side of the screen (by position or by creating a sprite with collision detection). Then you can use the tween commands to scroll on a sprite/sprites.
I use a similar method here at 1m30s: - https://youtu.be/_AP3hm_YgQg?t=1m25s.

Parallax scrolling is where you have several layers moving at different speeds, to give the perception of depth, like mountains and clouds, or starfields.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 31st May 2016 19:34
Awesome example BatVink, great video!

I have been checking out the percentage system for controlling the size and position of entities and was wondering do I need to specify anything before using it?

I have my GetHeight(), GetWidth() functions before the main loop of my app, I come from an HTML/CSS background so I am not to sure if I need to specify anywhere before my main loop if I am using the percentage system rather than screen coordinates.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st May 2016 21:31
The percentage system is the default, so you do not need to do anything.
There is a divide on the forums between using percentage and virtual resolution (VR). I would estimate 75% use the VR. I fall into the VR camp.
You can use SetScissor() to open up the full screen, or use GetDeviceHeight() / GetDeviceWidth() to set your VR to the exact screen size.
I'm working on a user interface, but still use VR over percentage for my sizing and positioning.

The other 25% are the clever ones, who can handle the unsquashing of sprites without getting a headache
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
devdavejames
9
Years of Service
User Offline
Joined: 23rd Nov 2014
Location: United Kingdom
Posted: 3rd Jun 2016 01:35
Just out of interest. I was wondering what tools you guys use in regards to making UI elements and what is your workflow. Do you make components, taking a modular approach for sections of your UI. Do you use vector programs or Photoshop.

Thanks

Login to post a reply

Server time is: 2024-11-21 20:46:57
Your offset time is: 2024-11-21 20:46:57