View Single Post
  #7  
Old 03-12-2008, 11:46 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Yes and like I said, use a TStaticVar object and define its functions with function objects or a class.
PHP Code:
//// Example Script
function onCreated() {
  
this.topleft Objects.Rect(null00screenwidth 2screenheight 2);
}
function 
GraalControl.onMouseDown() {
  if (
this.topleft.inside(mousescreenxmousescreeny)) {
    
// do stuff
  
}
}
//// Weapon Script: Objects
public function Rect(objnamenxnynwnh) {
  
temp.obj = new TStaticVar(""@objname);
  
obj.int(nx);
  
obj.int(ny);
  
obj.int(nw);
  
obj.int(nh);
  
obj.join("type_rect");
  return 
obj;
}
//// Class Script: type_rect
function inside(nxny) {
  if (
nx in |this.xthis.this.w| && ny in |this.ythis.this.h|) {
    return 
true;
  }
  return 
false;
}
public function 
objecttype() {
  return 
"TRect";

It is not necessary to include what you're saying into GScript when the same functionality can already be achieved.
__________________

Last edited by Inverness; 03-13-2008 at 12:00 AM..
Reply With Quote