Post: destroy() & destroyElem()
01-28-2016, 02:43 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); as topic title suggest what are differences between destroy() & destroyElem()
(adsbygoogle = window.adsbygoogle || []).push({});
01-28-2016, 03:00 AM #2
Originally posted by OfficialCoolJay View Post
as topic title suggest what are differences between destroy() & destroyElem()


I believe destroy can destroy entities, while other one cannot

The following user thanked John for this useful post:

UnknownKiller
01-28-2016, 03:00 AM #3
HiddenHour
I defeated!
I am interested in this as well.
01-28-2016, 03:52 AM #4
anthonything
Space Ninja
DestroyElem is present in the HUD utility and uses a more advanced loop to traverse through elements of an object and clears all components, whereas Destroy is the most basic HUD deletion method, defined in CSC.

This is the code for DestroyElem
    destroyelem()
{
tempchildren = [];
index = 0;
while ( index < self.children.size )
{
if ( isDefined( self.children[ index ] ) )
{
tempchildren[ tempchildren.size ] = self.children[ index ];
}
index++;
}
index = 0;
while ( index < tempchildren.size )
{
tempchildren[ index ] setparent( self getparent() );
index++;
}
if ( self.elemtype == "bar" || self.elemtype == "bar_shader" )
{
self.bar destroy();
self.barframe destroy();
}
self destroy();
}

The following 3 users say thank you to anthonything for this useful post:

DF_AUS, HiddenHour, OfficialCoolJay
01-28-2016, 06:35 AM #5
Originally posted by anthonything View Post
DestroyElem is present in the HUD utility and uses a more advanced loop to traverse through elements of an object and clears all components, whereas Destroy is the most basic HUD deletion method, defined in CSC.

This is the code for DestroyElem
    destroyelem()
{
tempchildren = [];
index = 0;
while ( index < self.children.size )
{
if ( isDefined( self.children[ index ] ) )
{
tempchildren[ tempchildren.size ] = self.children[ index ];
}
index++;
}
index = 0;
while ( index < tempchildren.size )
{
tempchildren[ index ] setparent( self getparent() );
index++;
}
if ( self.elemtype == "bar" || self.elemtype == "bar_shader" )
{
self.bar destroy();
self.barframe destroy();
}
self destroy();
}


ahh thanks man i had a feeling thats what it kinda did

so basically if i was to create a text or shader

    self.openmenu = createText("default", 1.5, "Open The Menu", "center", "center", -620, 217, 2, false, 1, (1, 1, 1), 0, (0, 0, 0));


then later self.openmenu destroy();

it only destroys the text/ or shader itself but not its color/glow/alpha properties with it

so if i was to do this after destroy(); the text
    
self.openmenu setText("Open The Menu");


it would still have all the original color/glow/alpha properties it had before hand?
01-28-2016, 12:26 PM #6
anthonything
Space Ninja
Originally posted by OfficialCoolJay View Post
ahh thanks man i had a feeling thats what it kinda did

so basically if i was to create a text or shader

    self.openmenu = createText("default", 1.5, "Open The Menu", "center", "center", -620, 217, 2, false, 1, (1, 1, 1), 0, (0, 0, 0));


then later self.openmenu destroy();

it only destroys the text/ or shader itself but not its color/glow/alpha properties with it

so if i was to do this after destroy(); the text
    
self.openmenu setText("Open The Menu");


it would still have all the original color/glow/alpha properties it had before hand?


That is my interpretation.

The following user thanked anthonything for this useful post:

OfficialCoolJay

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo