zyzzate
Topic Author
Posts: 3
Joined: 24 Apr 2018, 09:37

Make NoesisGUI work with Leadwerks again(Partly), Still need some help.

01 May 2018, 17:46

A few days ago, I wrote a post to ask how to integrate the NeosisGUI into the Leadwerks Game Engine because the NoesisLeadwerksWrapper(https://github.com/FourthQuarter/NoesisLeadwerksWrapper) was too outdated. Thank @jsantos, that he told me updating the integration would be easy if i read the Integration Tutorial and C++ Architecture Guide. Today i spend some to read those pages and make some changes to the source code of NoesisLeadwerksWrapper and finally i make the NoesisGUI functions(partly) again in Leadwerks. But there are still many problems such as the GUI cannot response the input event(both mouse and keybord event). So i post again for your help, maybe someone would help me locate the problem and figrue out the soultion.Thanks.

zyzzate

Some pics here:

Image
Image
Image
 
zyzzate
Topic Author
Posts: 3
Joined: 24 Apr 2018, 09:37

Re: Make NoesisGUI work with Leadwerks again(Partly), Still need some help.

02 May 2018, 13:52

[Upadte] Finally made the mouse and keyboard work, i made a stupid mistake. More test to run and the mouse wheel still does not work cause i don't know how to caputre the mouse wheel event from leadwerks.
Image
Image
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Make NoesisGUI work with Leadwerks again(Partly), Still need some help.

03 May 2018, 15:24

Great to know you are progressing.

Our API is very simple regarding input. You just need to find how Leadwerks input events are generated, listen to them and then inject the events to the Noesis View using these functions:
struct IView
{
    /// ...
    
    /// Notifies that a mouse button was pressed. Origin is in the upper-left corner
    virtual void MouseButtonDown(int x, int y, MouseButton button) = 0;

    /// Notifies that a mouse button was released. Origin is in the upper-left corner
    virtual void MouseButtonUp(int x, int y, MouseButton button) = 0;

    /// Notifies that a mouse button was double clicked. Origin is in the upper-left corner
    virtual void MouseDoubleClick(int x, int y, MouseButton button) = 0;

    /// Notifies that mouse was moved. Origin is in the upper-left corner
    virtual void MouseMove(int x, int y) = 0;

    /// Notifies that mouse vertical wheel was rotated. Origin is in the upper-left corner
    /// The parameter wheelRotation indicates the distance the wheel is rotated, expressed in
    /// multiples or divisions of 120 (is the default value for 3 lines of scrolling). A positive
    /// value indicates that the wheel was rotated forward, away from the user; a negative value
    /// indicates that the wheel was rotated backward, toward the user
    virtual void MouseWheel(int x, int y, int wheelRotation) = 0;

    /// Notifies that mouse horizontal wheel was rotated. Origin is in the upper-left corner
    /// The parameter wheelRotation indicates the distance the wheel is rotated, expressed in
    /// multiples or divisions of 120 (is the default value for 3 lines of scrolling). A positive
    /// value indicates that the wheel was rotated to the right; a negative value indicates that
    /// the wheel was rotated to the left
    virtual void MouseHWheel(int x, int y, int wheelRotation) = 0;

    /// Notifies that a vertical scroll is being actioned. This is normally mapped to a gamepad axis.
    /// Value range from -1 (fully pressed down) to +1 (fully pressed up)
    virtual void Scroll(float value) = 0;

    /// Notifies that a horizontal scroll is being actioned. This is normally mapped to a gamepad axis.
    /// Value range from -1 (fully pressed left) to +1 (fully pressed right)
    virtual void HScroll(float value) = 0;

    /// Notifies that a finger touched the screen. Origin is in the upper-left corner
    virtual void TouchDown(int x, int y, uint64_t id) = 0;

    /// Notifies that a finger moved on the screen. Origin is in the upper-left corner
    virtual void TouchMove(int x, int y, uint64_t id) = 0;

    /// Notifies that a finger raised off of the screen. Origin is in the upper-left corner
    virtual void TouchUp(int x, int y, uint64_t id) = 0;

    /// Notifies that a key was pressed
    virtual void KeyDown(Key key) = 0;

    /// Notifies that a key was released
    virtual void KeyUp(Key key) = 0;

    /// Notifies that a key was translated to the corresponding character
    virtual void Char(uint32_t ch) = 0;
    
    /// ...
};
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Make NoesisGUI work with Leadwerks again(Partly), Still need some help.

03 May 2018, 19:11

This is awesome, is there a github for this?

Who is online

Users browsing this forum: No registered users and 1 guest