Windows phone 8 port on cocos2d-x - windows-phone-8

I am facing a problem in porting andoird games to windows phone 8 on cocos2d-x. I have following problem in all of them
The BG music continues to play when I press WINDOWS button.
It pauses when i press the button but after 5-10 seconds starts to play again
Thanks in advance for any assistance.
Aqeel Raza

Go to cocos2dRenderer.cpp
find the Disconnect() method.
write this line in the method
mApp->applicationDidEnterBackground();
and similarly call the following line in CreateGLResources(); function
//should be applicationWillEnterForeground()
mApp->applicationWillEnterForeground();
Hope this will solve your problem.
Best of luck.

Related

Why is the type() function not executed in this script?

I am new to Sikulix and I am running into a problem.
I am trying to follow a tutorial, but the type() function does not seem to work.
I am working on a windows 10 machine 64bit, with sikulix 1.1.3 IDE.
Below is an image of my simple script in which I try to start the calculator in windows.
Both clicks are executed, but the type is not. It also doesn't show up in the log screen:
Is this a bug or am I missing something?
Put a wait(1) right after the click
And do
type("Calc")
type(Key.ENTER)
The issue you're having is your type statement: type("calc" + Key.ENTER)
This should be avoided.
You could try type("calc", Key.ENTER) but I'm unsure if this works. Hope this helps!
I think this is a bug in 1.1.3.
I am running 1.1.0 on a 64 bit Windows 10 PC and this code worked fine for me. I have never had issues concatenating a Key with a String because in Sikuli most of the key constants are actually String values including Key.ENTER documented here.
Maybe try:
wait(image)
type(image, "calc" + Key.ENTER)
Using type this way will click the image and then type whatever is in the second parameter.
Side note for #Michell Monarch:
type("calc", Key.ENTER) will search for the text "calc" on the screen, click it, and then press enter

Game Maker studio: When I run the game

After I loaded the game up I get this error message below
I loaded the game back up and though it worked again because my slime enemy are still moving around the game but when I left clicked the mouse, my game just freezes and I have to end up exiting out the game.
I went to game maker community website page and see others with the same issue as I did, but most people said it's something with game maker studio's file > preferences and on the window's tab I see the location.
I pressed check windows SDK button and though it worked because I see status shows Visual studio is OK. I though that worked any ideas?
// In Script scr_check_for_player at line 1 : unknown function or script instance_exist
// In Script scr_enemy_choose_next_state at line 3 : wrong number of arguments for function irandom
// In Script scr_enemy_choose_next_state at line 3 : malformed assignment statement
// Compile Failed - Please check the Compile window for any additional information
To the best of my knowledge, the game maker function instance_exist is actually instance_exists, try that and see if it is correct. Also, search for the arguments in the function irandom and apply it correctly.

Windows 8.1, Adding camera capture task not importing?

I'm trying to put a camera capturing task/event into my application I'm building. But everytime I try to do the import, "using Microsoft.Phone.Tasks;" It gives me an error and "phone" is highlighted in red. Can't seem to figure out what the bug is, can anyone help?
Here's an image of my problem.
![problem] file:///C:/Users/Qamar/Desktop/Problem.png
thanks!
Think you're using WP8.1 runtime, so that namespace is not available.
See microsoft-phone-tasks-namespace-is-not-available
In WP8.1 runtime you need to use Windows.Phone.Media.Capture namespace for most of your camera needs.

How to cancel or manage focus of a PhotoCaptureDevice in Windows Phone 8

I had a camera app for WP7 which was able to control focus so when the user released the shutter button, focus action was properly cancelled.
Now I'm trying to migrate this app to WP8 but I can't find anywhere how to reproduce this.
Any ideas?
Best regards.
I've found the answer, just in case you ever need it.
You have to use this line:
//Device is a PhotoCaptureDevice instance
Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.Focus);
This will cause the focus operation to pause.
Then, whenever you want to use the autfocus again you have to reset the locked parameter like this:
Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.None);
Let me know if it doesn't work for you :D

close air app, where is it?

Seems System.exit(0) and flash.system.System.exit(0) both throw the error "[Fault] exception, information=SecurityError: Error #2018: System.exit is only available in the standalone Flash Player."
I'm creating a fullscreen app and im simply want to add a close button that will close all windows and exit (i have a secondary window via NativeWindow open). Tons and tons of googling any nothing. Makes me wonder if im missing something super simple since all "chromless" apps would have to have this.
Poking around I found stage.NativeWindow but closing that does not exit the whole app.
*note I am building and testing in flashdevlop 4.0 with pure as3, no flex.
NativeApplication.nativeApplication.exit();
When in doubt, check the docs! :)
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApplication.html#exit()