Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

819 B
Raw Blame
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
#pragma once

#include "BatchPlugin.hpp"
#include "../../resource/TextureMetadata.hpp"
#include "../../core/Reflection.hpp"

namespace esengine {

class UIElementPlugin : public BatchPlugin {
public:
    bool drawsScreenUI() const override { return true; }
    void collect(RenderCollectContext& ctx) override;
    const char* collectScope() const override { return "render.collect.ui"; }

    // UI draws above world content: its sort layer is offset past the world
    // layer range. The SDK's own text renderer puts quads at the same base, so
    // it crosses — and a second spelling of it is two layers, not one.
    ES_CONST()
    static constexpr i32 UI_BASE_LAYER = 1000;
};

}  // namespace esengine