DEKI/ENGINE 문서
매뉴얼 API 참조
Deki 0.40.1
비주얼 에디터가 있는 2D·3D 모듈식 C++ 엔진
로딩중...
검색중...
일치하는것 없음
Assets

이 가이드는 아직 번역되지 않았습니다.

An asset is a file your game uses: an image, a font, a scene, an animation.

Add one

Drag the file onto the Asset Browser, or copy it into the project's assets folder. The editor imports it on its own.

File Becomes
.png An image. See Sprites
.ttf, .bdf A font. See Text
.scene A scene
.anim An animation. See Animation

Keep the .data file with it

Beside each asset is a file of the same name ending in .data. It holds the asset's settings and its id, and fields point at that id. Move and rename assets in the Asset Browser, so the two stay together and nothing that uses them breaks.

Use one

Choose it in the Inspector. A field like Sprite or Font offers the assets of that kind.

For your own components, add a field:

DEKI_EXPORT
Deki::AssetRef<Deki2D::Sprite> hurtSprite;

Use it like a pointer. The asset loads the first time your code needs it.

if (hurtSprite)
{
sprite->sprite = hurtSprite.Get();
}

Different settings per device

An image's settings can differ per device, such as a smaller Max Size where memory is short: see Sprites. Each device's build gets its own copy, so your other targets are not affected.

The Memory panel shows what a scene will take on a device before you run it.

How assets are stored and found is covered under Working on Deki, in Asset System.