Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Bug Report
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-06-2011, 08:13 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
iOS getAcceleratorAxis

This was posted way back when in the Classic iPhone thread.

PHP Code:
xaxis = -(getangle(getAcceleratorAxis(0), getAcceleratorAxis(1)) - pi); // stays at pi/2
yaxis getAcceleratorAxis(2); // stays at 0 
Doesn't work.
__________________
Quote:
Reply With Quote
  #2  
Old 01-06-2011, 10:19 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by fowlplay4 View Post
This was posted way back when in the Classic iPhone thread.

PHP Code:
xaxis = -(getangle(getAcceleratorAxis(0), getAcceleratorAxis(1)) - pi); // stays at pi/2
yaxis getAcceleratorAxis(2); // stays at 0 
Doesn't work.
I made this on Classic iPhone Dev

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
enableAccelerator(true);
  
createProfile(); 
  
this.running true;
  
  new 
GuiProgressCtrl("x_progress") {
    
profile axisprofile;
    
useownprofile true;        
    
resize(501520025);
    
progress .5;
  }

  new 
GuiProgressCtrl("y_progress") {
    
profile axisprofile;
    
useownprofile true;        
    
resize(503520025);
    
progress .5;
  }

  new 
GuiProgressCtrl("z_progress") {
    
profile axisprofile;
    
useownprofile true;        
    
resize(505520025);
    
progress .5;
  }
  
setTimer(0.05);
}

function 
onPlayerChats() {
  if (
player.chat == ":toggleaxis") {
    
this.running = !this.running;
    
    if (
this.running) {
      
enableAccelerator(true);
      if (
timeout <= 0)
        
setTimer(0.1);
    }
    else {
      
enableAccelerator(false);
      
setTimer(0);
    }
  }
}

function 
onTimeout() {
  
temp.xaxis = (roundto(getAcceleratorAxis(0), 0.05))/2;
  
temp.yaxis = (roundto(getAcceleratorAxis(1), 0.05))/2;
  
temp.zaxis = (roundto(getAcceleratorAxis(2), 0.05))/2;

  
x_progress.progress temp.xaxis+.5;
  
y_progress.progress temp.yaxis+.5;
  
z_progress.progress temp.zaxis+.5;    
  
setTimer(0.25);
}

function 
roundto(valdec)
  return 
int(val/dec 0.5) * dec;

function 
createProfile() {
  new 
GuiProgressProfile("axisprofile") {
    
this.copyfrom("GuiBlueProgressProfile");
    
bordercolor={0,0,0};
    
bordercolorhl={0,0,0};
    
bordercolorna={0,0,0};
    
fillcolor={255,0,0};
    
fillcolorhl={255,0,0};
    
fillcolorna={255,0,0};
  }

I found each axis has a value between -1 and 1. The bars make it quite easy to follow
Reply With Quote
  #3  
Old 01-06-2011, 10:36 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
PHP Code:
enableAccelerator(true); 
Seems to have been the missing key.

I imagine it's a good idea to turn it off when done for battery etc. as well.
Reply With Quote
  #4  
Old 01-06-2011, 11:44 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Thanks, I had a vague memory that there was some sort of enable function that had to be called before. Maybe I will add an easter egg effect here and there after all.
__________________
Quote:
Reply With Quote
Reply

Tags
accelerator


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.