AftGangAglay Documentation


mkobj

Note: It is advised that you read the object documentation before this page in order to familiarise yourself with relevant terms and concepts.

Parameters

Parameter Type Description
path string The object path to load

Return Value

Type Description
nativeptr The loaded object

Description

Loads a graphical object from its configuration file, as well as any associated resources.

Once the object is no longer in use, it should be destroyed using killobj.

Example

import agan

class game():
	def create(self):
		self.obj = agan.mkobj('foo.sgml')
		return self
	#
	def update(self):
		if(agan.inobj(self.obj, [ 1.0, 0.0, 5.0 ], 1, 0)):
			agan.text('Hello', [ 0.5, 0.5 ])
		#
		agan.log(agan.objtrans(self.obj))
		agan.log(agan.objconf(self.obj, [ 'Model' ]))
		#
		agan.putobj(self.obj)
	#
	def close(self):
		agan.killobj(self.obj)