Hide and show from List
BlitzMax Forums/MiniB3D Module/Hide and show from List
| ||
Hi, could someone please explain me how I can use the command HideEntity and ShowEntity with Objects in a List. I have... (stripped down) If KeyDown(KEY_NUMADD) For Local i:Int = 0 To 99 spClients:TClient = New TClient spClients.setOnRadius(weniversum.radius) spCount = spClients.clientsCount() Next End If Type TClient Global list:TList = New TList Method New() list.AddLast(Self) _sphere = CreateSphere(4) End Method End Type in the main loop I want to do a Hide and Show before rendering. I have tried for eachin, nada and so on...HideEntity(spClients._sphere) nada... Must I go through ALL the objects? or is there a way to say 'all objects in list' ? |
| ||
For Local C:TCLient = EachIn TCLient.List If HideParameter = True Then HideEntity(C._Sphere) Else ShowEntity(C._Sphere) EndIf Next This should normally do it. Hideparameter should be replaced with you determination how to hide and show the spheres. |
| ||
Ahh yes, I didn't quite grasp this concept yet. I had two errors with my eachin loop. First I had C:TEntity then C:Object and as second error I didn't think of the dot syntax. Although it is all very logical, oh well Thanks a lot! |