Home - Forums - Documentation - Gallery - Bugs
(New page: = Introduction = = A Simple Python Property Class = <source lang="python"> from pycel import * import random class RotatePropClass(pyPcCommon): def __init__(self,oreg): ...)
(A Simple Python Property Class)
Line 3: Line 3:
= A Simple Python Property Class =
= A Simple Python Property Class =
<source lang="python">
<source lang="python">
 +
from pycel import *
from pycel import *
import random
import random

Revision as of 21:46, 11 February 2008

Introduction

A Simple Python Property Class

from pycel import *
import random
 
class RotatePropClass(pyPcCommon):
        def __init__(self,oreg):
                pyPcCommon.__init__(self,oreg)
                pl.CallbackEveryFrame(self,CEL_EVENT_PRE)
                self.foo = 160
        def ReceiveMessage(msg_id,sender,ret,params):
                pass
        def TickEveryFrame(self):
                mov = celMesh(self.GetEntity()).Mesh.GetMovable()
                rot = csYRotMatrix3(0.1)
                mov.Transform(rot)
                mov.UpdateMove()
 
CEL_IMPLEMENT_FACTORY(RotatePropClass,"pcrotate")
| Article | Discussion | View source | History |