Jump to content

Copied Icon have no data/image


Go to solution Solved by Josh,

Recommended Posts

Posted
#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[]) {
    //Get the displays
    auto displays = GetDisplays();

    //Create window
    auto window = CreateWindow("Ultra Engine", 0, 0, 200, 300, displays[0]);

    //Create user interface
    auto ui = CreateInterface(window);

    //Create a pixmap
    auto icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Logos/23.svg");
    auto icon2 = icon->Copy()->As<Icon>();
    auto panel1 = CreatePanel(0, 0, 100, 100, ui->root);
    panel1->SetIcon(icon, PIXMAP_STRETCH);

    auto panel2 = CreatePanel(0, 101, 100, 100, ui->root);
    panel2->SetIcon(icon2, PIXMAP_STRETCH);

    //Show the icon
    //ui->root->SetIcon(icon);

    while (true) {
        const Event ev = WaitEvent();
        switch (ev.id) {
        case EVENT_WINDOWCLOSE:
            return 0;
            break;
        }
    }

    return 0;
}

 

  • Thanks 1

Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

  • Solution
Posted

Thanks. I found that the SVG parser for some strange reason modifies the data passed to it. Once I figured that out it was easy to just make a copy of the string before parsing it.

The fix will be included in the first build of 0.9.7 beta.

  • Like 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...