Jump to content


master higgins

Member Since 06 Sep 2011
Offline Last Active Mar 14 2012 01:51 PM

Posts I've Made

In Topic: keyboard_key_press function in android

12 March 2012 - 07:09 PM

Hi, I've tried using the keyboard_key_press function to simulate key presses in android since I'm porting a game I made in GM 8.1 and I use a lot of keyboard_check_press invocations in the code. I was wondering if it's possible to send virtual keystrokes with keyboard_key_press so keyboard_check_pressed detects the event.

If anyone has tried this please enlighten me, so if it doesn't work that way I continue replacing the keyboard_check_pressed invocations with direct readings of the state of the on-screen controls I'm making.

Thanks for any replies!
Greets!


Anyone has succeded using this function so far?

Actually, what I'd like to know if keyboard_key_press can be read by keyboard_check_pressed or it's impossible since they'll be always be out of sync. For example, if keyboard_key_press is on in the step event of one object and keyboard_check_pressed is in the step event of another object I guess the first can't reach the second because the keyboard_key_press lasts only for the step event of the first object and in the step event of object 2 is inactive.

I hope someone in the staff can help me figure this behaviour. It'd be nice if all functions that don't work in a certain platform be striked out or shown as syntax errors.

Thanks! ;)

In Topic: Avoiding screen stretching?

11 March 2012 - 10:38 PM

IIRC, according to YoYo's staff, running an application on Android through YoYoRunner yields those problems. When exporting directly to an .apk it should respect the orientation and size configuration. But that feature (export directly to an apk, not through com.yoyogames.
runner.apk
) is reserved for the stable release.

In Topic: Screen stretching and landscape on Android

09 March 2012 - 12:49 AM


They want you to learn how to adapt room size to a phone by yourself. That's obvious

How does one do this? Everytime I turn my phone horizontally it stretches, no matter what I try! :o


You may try setting the room_width and room_height variables to browser_width and browser_height. Curiously, those browser_* variabled seemed to work because a test application of mine didn't get stretched despite the platform was android. Give it a try, I don't know if those variables change on runtime if you change the orientation (that is, browser_height and browser_width values getting swapped).

On my side, I can't confirm this because the android SDK is all f****d up as it shows an error saying that it can't find the file game.droid
I/yoyo    (  272): onCreate
I/yoyo    (  272): #######!!!!!!! Checking for runner - exception - java.io.FileNotFoundException: game.droid

Besides that is the huge lag between the input and that very often the emulator gets stuck in the locked state and I can't unlock it by sliding the unlock button because it doesn't respond!

Greets!

In Topic: Screen stretching and landscape on Android

08 March 2012 - 07:03 PM

They want you to learn how to adapt room size to a phone by yourself. That's obvious


I think you're referring to adapt the view size and view port to the phone screen size, since adapting the room size would be ridiculous: imaging adapting the room size of a platformer whose room size is 8000x2000 to a screen size of 320x240 (scaling horror!).

So by your point of view, we are forced to make the view the same size as the screen, without any chance to put borders around it.

In my particular case this mess all of my 2.5d beat'em up, since enemies are placed strategically through the map and the scrolling stops if you reach a multiple of the view width. Then, after defeating all enemies on that place, you go forward til you reach the next scrolling stop point (another multiple of view_wview[view_current]).

Making the view adapt to the screen size would mean making more or less enemies appear (generally more since the screens are greater than 320x240 which is my game resolution so more enemies are shown at the same time) thus screwing the game difficulty and forcing me to make an automatic enemy re-layout depending on the phone screen size (making the level editor almost useless)

I don't see what's the point of the "100%" scale option if it scales the view and rendering area by default to the screen size.

Guess we'll have to wait for the stable release.

In Topic: Screen stretching and landscape on Android

08 March 2012 - 11:13 AM

And what about screen stretching?

I've tried setting the room size, the view and the viewport to 320x240, setting a fixed scale of 100%, disable full screen mode and disable the change resolution option. The smartphone resolution is 480x800, but the game still gets stretched.

Is there any way to avoid it? Or will I have to wait till the stable release?

Greets!.