Graal Forums  

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

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
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
Reply

Tags
accelerator

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 07:37 PM.


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