Sign in to follow this  
VasiDe

CEF for C# does not load at all.

Recommended Posts

Hi everyone,

 

I am playing with C# for RageMP I unfortunately I don't get one thing with CEF. I'm keep learning how to use some events and this time I have to create some UI to use them.

UI based on Javascript works great (e.g. https://rage.mp/forums/topic/1896-cef-tutorial-interact-with-browser-pages-in-ragemp-client-and-server/) however when I write my own code  in C# - it does not show at all. I am using Stuyk tutorial from https://www.youtube.com/watch?v=NJsktWiY5W8 and it is not working. Even tried to copy everything 1:1 and script literally does not respond.

Recent code (based on Stuyk tutorial):

using System;
using RAGE;
using RAGE.Elements;
using RAGE.Ui;

namespace hello
{
    public class Main : Events.Script
    {
        RAGE.Ui.HtmlWindow CustomWindow = null;

        public Main()
        {
            LoadCEF("package://html/index.html");
        }
        public void LoadCEF(string uri)
        {
            CustomWindow = new HtmlWindow(uri)
            {
                Active = true
            };
        }
    }
}

 

html file contains proper template with HTML5 encoding and body bg color set for black only. Works with local browsers such as Firefox and Chrome.

Cleared cache memory several times to make sure it's overwriting the new one.

 

Some suggestions?

Thank you in advance

VasiDe

 

 

Share this post


Link to post
Share on other sites

Where did you save the HTML File? Remember it has to be placed in "client_packages/html" in your case.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.