//-------------------------------------------------------------------------- void ExampleInit() { //Register for standard pointer events s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)SingleTouchButtonCB, NULL); s3ePointerRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)SingleTouchMotionCB, NULL); // Init buttons. startBtn = NewButton("Start MAT SDK"); showParmsBtn = NewButton("Show SDK Parameters"); sendInstallBtn = NewButton("Send Install"); sendEventRefBtn = NewButton("Send Event With Ref"); sendEventBtn = NewButton("Send Event Items"); setDebugBtn = NewButton("Set Debug on/off"); int32 osInt = s3eDeviceGetInt(S3E_DEVICE_OS); if (osInt == S3E_OS_ID_ANDROID) { strcpy(g_package_name, "com.marmaladeandroidtest"); strcpy(g_site_id, "7488"); } else { strcpy(g_package_name, "2GLFC47AY5.com.hasoffers.marmaladeTestApp"); strcpy(g_site_id, "6864"); } SetButtonScale(2); }
void LevelSelectMainInit() { // Determine if the device has a keyboard if (s3eKeyboardGetInt(S3E_KEYBOARD_HAS_KEYPAD) || s3eKeyboardGetInt(S3E_KEYBOARD_HAS_ALPHA)) g_DeviceHasKeyboard = true; int scale = 1; // Set default button size relative to screen resolution if (s3eSurfaceGetInt(S3E_SURFACE_WIDTH) < 320 || s3eSurfaceGetInt(S3E_SURFACE_HEIGHT) < 320) scale = 1; else if (s3eSurfaceGetInt(S3E_SURFACE_WIDTH) < 480 || s3eSurfaceGetInt(S3E_SURFACE_HEIGHT) < 480) scale = 2; else scale = 3; SetButtonScale(scale); // Scale font up to be easier to read int fontScale = scale > 1 ? scale-1 : 1; s3eDebugSetInt(S3E_DEBUG_FONT_SCALE, fontScale); LevelInit(); }
void ExampleInit() { #define NUM_MESSAGES 30 #define MESSAGE_LEN 80 InitMessages(NUM_MESSAGES, MESSAGE_LEN); AppendMessageColour(GREEN, "Checking for extension"); SetButtonScale(GetButtonScale()-1); g_MessageBox = NewButton("MessageBox"); if (s3eNOpenFeintAvailable()) { g_NOFInitialize = NewButton("OF Initialize"); g_NOFShutdown = NewButton("OF Shutdown"); g_NOFLaunchDashboard = NewButton("OF LaunchDashboard"); g_NOFTestButton1 = NewButton("OF Test 1"); g_NOFTestButton2 = NewButton("OF Test 2"); // Register for callbacks AppendMessageColour(BLUE, "*************"); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessageColour(GREEN, "Registering for callback"); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_PLAYER_LOGGEDIN, &playerLoggedIn, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DASHBOARD_DID_APPEAR, &dashBoardAppeared, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DID_DOWNLOAD_ALL_CHALLENGE_DEFINITIONS, &didDownloadAllChallengeDefinitions, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DID_FAIL_DOWNLOAD_CHALLENGE_DEFINITIONS, &didFailDownloadChallengeDefinitions, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_USER_LAUNCHED_CHALLENGE, &userLaunchedChallenge, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_IS_OPENFEINT_NOTIFICATION_ALLOWED, &isOpenFeintNotificationAllowed, NULL); } else { AppendMessageColour(RED,"Could not load s3eNOpenFeint extension"); return; } if(s3eFacebookAvailable()) { s3eFBInit("193667878484"); } else AppendMessageColour(RED,"Could not load s3eFacebook extension"); // if (!s3eIOSNotificationsAvailable()) // { // AppendMessageColour(RED,"Extension Not Available"); // return; // } // else { // // Register IOS Notification // // s3eDeviceRegister(S3E_DEVICE_PUSH_NOTIFICATION, RemotePushNotificationRecieved, 0); // s3eIOSNotificationsRegister(S3E_IOSNOTIFICATIONS_REMOTE, RemotePushNotificationRecieved, NULL); // // // s3eIOSNotificationsGetLaunchNotification(); // } // g_is3eNGAvailable = NewButton("IsNGAvailable"); }