counting types

Blitz3D Forums/Blitz3D Beginners Area/counting types

stayne(Posted 2006) [#1]
For example I have created 2 objects in a Type and I want to display the amount. Is the only option to create a global variable and increment it when creating a new object?

Example:

Type model
  field mesh
End Type

m.model = new model
m\mesh = blah

m.model = new model
m\mesh = blah

;main-----------

Text 10,10,"Number of models: "+ ????



(tu) sinu(Posted 2006) [#2]
yep or do

count = 0
for m.model= each model
 count = count + 1
next

Text 10,10,"Number of models: "+ count



stayne(Posted 2006) [#3]
Gracias. Sometimes the simple stuff eludes me.

I shall leave you with a screenshot of my game's editor (models are not lightmapped):