# Many improvements: behaviors attached to TCastleTransform (a bit like MonoBehaviour), alphaMode and alphaCutoff from X3D 4.0 and glTF, Android services docs, loading/saving from TStream

**URL:** https://forum.castle-engine.io/t/many-improvements-behaviors-attached-to-tcastletransform-a-bit-like-monobehaviour-alphamode-and-alphacutoff-from-x3d-4-0-and-gltf-android-services-docs-loading-saving-from-tstream/297
**Category:** News
**Created:** [February 12, 2021, 9:57pm UTC](https://forum.castle-engine.io/t/many-improvements-behaviors-attached-to-tcastletransform-a-bit-like-monobehaviour-alphamode-and-alphacutoff-from-x3d-4-0-and-gltf-android-services-docs-loading-saving-from-tstream/297 "2021-02-12T21:57:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [February 12, 2021, 9:57pm UTC](https://forum.castle-engine.io/t/many-improvements-behaviors-attached-to-tcastletransform-a-bit-like-monobehaviour-alphamode-and-alphacutoff-from-x3d-4-0-and-gltf-android-services-docs-loading-saving-from-tstream/297/1 "2021-02-12T21:57:09Z")

</div>

| [![Zrzut ekranu z 2021-02-12 22-50-36](https://castle-engine.io/wp/wp-content/uploads/2021/02/Zrzut-ekranu-z-2021-02-12-22-50-36-200x117.png)](https://castle-engine.io/wp/wp-content/uploads/2021/02/Zrzut-ekranu-z-2021-02-12-22-50-36.png "Zrzut ekranu z 2021-02-12 22-50-36") |
| [![Zrzut ekranu z 2021-02-12 22-54-41](https://castle-engine.io/wp/wp-content/uploads/2021/02/Zrzut-ekranu-z-2021-02-12-22-54-41-200x117.png)](https://castle-engine.io/wp/wp-content/uploads/2021/02/Zrzut-ekranu-z-2021-02-12-22-54-41.png "Zrzut ekranu z 2021-02-12 22-54-41") |

1. We introduce a new class [TCastleBehavior](https://castle-engine.io/apidoc-unstable/html/CastleTransform.TCastleBehavior.html) which can be attached to any [TCastleTransform](https://castle-engine.io/apidoc-unstable/html/CastleTransform.TCastleTransform.html) to perform some job. You can create descendants of it (or use ready descendants of it in CGE) and override methods like `Update`.

2. [LoadNode](https://castle-engine.io/apidoc-unstable/html/X3DLoad.html#LoadNode) overload that takes a `TStream` with scene contents, and `MimeType` as a `String`.

3. [SaveNode](https://castle-engine.io/apidoc-unstable/html/X3DLoad.html#SaveNode), a better name for `Save3D`, with simpler API (Save3D has way too many overloads, and is now deprecated). With only 2 overloads, to save to `URL` or to `TStream`.

4. [TImageTextureNode](https://castle-engine.io/apidoc-unstable/html/X3DNodes.TImageTextureNode.html) utilities to load images from any TStream or TEncodedImage instance, without the need to load from any URL: [LoadFromStream](https://castle-engine.io/apidoc-unstable/html/X3DNodes.TImageTextureNode.html#LoadFromStream), [LoadFromImage](https://castle-engine.io/apidoc-unstable/html/X3DNodes.TImageTextureNode.html#LoadFromImage).

5. I have extended X3D 4.0 to include alpha treatment parameters that correspond to glTF parameters: [Appearance.alphaMode and alphaCutoff (in Pascal: TAppearanceNode.AlphaMode and TAppearanceNode.AlphaCutoff)](https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD3/Part01/components/shape.html#Appearance). So these are now handled in both X3D 4.0 and glTF in CGE. Testcases: [in X3D in my x3d-tests](https://github.com/michaliskambi/x3d-tests/tree/master/alpha_mode), [in glTF in glTF-Sample-Models](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AlphaBlendModeTest).

6. New [examples/3d\_rendering\_processing/transform\_speed\_test/](https://github.com/castle-engine/castle-engine/tree/master/examples/3d_rendering_processing/transform_speed_test) – speed test of many TCastleTransform instances.

7. [Documentation how to implement new Android services](https://github.com/castle-engine/castle-engine/wiki/Adding-New-Android-Services).
