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

Hey VasiDE, 

did u solved that already? 
I'm stuck with the same problem.

would be nice if u could tell me your solution.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.