Ed-2D
Junior Member
Posts: 59
|
Post by Ed-2D on Jun 8, 2005 4:21:15 GMT
Is it possible ?
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on Jun 8, 2005 9:34:33 GMT
Not that I can see from the existing commands. The HUD_FX_AutoRemove creates a type field which holds a time-delay until the remove is carried out. It's probably possible to change the SpriteCandy source to add similar fields for HUD/Layer but the easiest thing would be to simulate your function by setting a time delay which is reduced until 0 and then issues HUD_RemoveLayer or HUD_Remove.
|
|
zac
New Member
Posts: 14
|
Post by zac on Jun 8, 2005 11:41:08 GMT
From what I can see, this is already possible. Here is how my autoremove code looks like in the effects update function:
Case FX_AUTOREMOVE ; ----------------------------- Select typ Case 1 HUD_RemoveObject FX\ObjID Case 2 HUD_RemoveLayer FX\ObjID Case 3 HUD_Remove FX\ObjID End Select Delete FX
I am using v.1.0.9 (beta), so if you're not, then you should update.
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on Jun 8, 2005 14:40:31 GMT
Hi Zac, I don't think that code ever gets called. When you use HUD_FX_AutoRemove it only checks the OBJ type whether OBJID exists. For layers/HUDs this check fails and you get the 'Object does not exist' message. SC_UpdateEffects checks OBJ, Layer and HUD for the OBJID and sets typ depending on the result. Could be a bug or an enhancement that was never coded. <edit> If you want to change the SpriteCandy code you can add...
; ------------------------------------------------------------------------ ; PUBLIC FUNCTION: AUTOREMOVE FX (OBJECTS) ; ------------------------------------------------------------------------ Function HUD_FX_AutoRemove% (ObjectID%, timedelay%) ; TGCHANGE Local HUDObj.SC_HUD = Object.SC_HUD (ObjectID) Local Layer.SC_Layer = Object.SC_Layer (ObjectID) Local Obj.SC_Object = Object.SC_Object(ObjectID) ; If Obj = Null Then RuntimeError SC_BreakText("HUD_FX_AutoRemove||The specified object does not exist.",50) If HUDObj = Null And Layer = Null And Obj = Null Then RuntimeError SC_BreakText("HUD_FX_AutoRemove||The specified object does not exist.",50) Local FX.SC_FX
; CLEAR PREVIOUS EFFECT OF THIS TYPE HUD_ClearEffects ObjectID, "AUTOREMOVE"
; CREATE NEW FX ITEM FX.SC_FX = New SC_FX FX\ObjID = ObjectID FX\name$ = "AUTOREMOVE" FX\typ = FX_AUTOREMOVE FX\start_time = MilliSecs() + timedelay Return Handle(FX) End Function
but make sure you back-up SpriteCandy.bb first. This is an unofficial change and it's possible Mike didn't implement it for a good reason.
|
|
zac
New Member
Posts: 14
|
Post by zac on Jun 8, 2005 20:20:55 GMT
Yes I see what you mean, I have never used autoremove on a hud or layer before, so I only checked the update code. I can't see why you couldn't change the autoremove function like you show, but I can't really see that many times where you would want to have the hud or layer autoremoved. Anyways, it is possible at least.
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on Jun 8, 2005 21:09:56 GMT
I'm not sure either. The HUD_RemoveLayers is useful for cleanup Ed-2D, was this out of curiosity or do you have something planned for Layer autoremove?
|
|
Ed-2D
Junior Member
Posts: 59
|
Post by Ed-2D on Jul 3, 2005 7:02:09 GMT
My game contains 2 layers: INGAME and HUD I want to display a special icon FX without redrawing all HUD
|
|