[PLUGIN] CGUI v0.02a (24/01/2011): Construct GUI

This forum is currently in read-only mode.
0 favourites
From the Asset Store
12 main music themes, 12 in-game loops and 24 win/lose stingers
  • Hum, strange error. CGUI plugin is built the same way as Input System and I don't think the drive is the reason. Have you verified that the plugins is correctly installed (beware of the runtime/edittime mixup)?

    No i am sure i placed them correctly and i tried a few times but always the same thing.

    I just tested it with my other computer that uses C drive though and it worked fine. I guess it was the E drive thing as i can't think of anything else why it would not work.

    I have it working on one computer though which is good and this is a really nice plugin by the way, many thanks.

  • zeno,

    I was getting that error after installing the plugin. I checked the dependencies of the csx files and found that they needed D3DX9_43.dll, which wasn't on my system. I updated DirectX to get the file and It works now.

  • I've nearly finished to remove all the drawing bugs, but I'm stuck with some transparency problem and I need some construct/DirectX guru to help me

    Here is the problem. In Edit mode, the GUI is displayed using DirectX directly and all is fine. In runtime mode I can't do the same because of the filters, scrolling things, etc... So I use the runtime renderer functions (essentially Quad_xywh) and I have a transparency problem.

    Here is the original from MyGUI build:

    Here is the result in Construct:

    As you can see on the slider, transparency is not correct, there is a black shadow. In this 3rd image, you can see what happens when switching form one tab to another:

    I need to find a way to remove this black shadow. If anyone can help me, I'll be greatful.

    By the way, here are my DirectX states:

    		mpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    		
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG0, D3DTA_DIFFUSE);
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
    
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG0, D3DTA_DIFFUSE);
    		mpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
    
    		mpD3DDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
    		mpD3DDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
    		mpD3DDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE );
    
    		mpD3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
    		mpD3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
    
    		mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,   D3DBLEND_SRCALPHA);
    		mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,  D3DBLEND_INVSRCALPHA);
    		
    		mpD3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
    		mpD3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
    		mpD3DDevice->SetRenderState(D3DRS_LIGHTING, 0);
    		mpD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
    		
    		mpD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);[/code:1ilcusc7]
  • YES !! I've found the reason. Colors and alpha are multiplied by Construct before rendering, for filter handling I think.

    I've added some hack for each vertices:

    				for(int c=0 ; c<4 ; c++)
    				{
    					vertexcolors[c].r /= vertexcolors[c].a;
    					vertexcolors[c].g /= vertexcolors[c].a;
    					vertexcolors[c].b /= vertexcolors[c].a;
    				}[/code:3p8lf3y9]
    
    Ugly but I don't know how to bypass this. A new demo should arrive soon.
  • zeno,

    I was getting that error after installing the plugin. I checked the dependencies of the csx files and found that they needed D3DX9_43.dll, which wasn't on my system. I updated DirectX to get the file and It works now.

    Thanks, i thought i already had the latest DirectX but maybe not so i will download it to see it it works.

  • Yeah after updating DirectX it now runs ok on this computer.

    By the way i found a bug -

    In your demo example i noticed if you preview it and click outside of the window (i did it in task manager to check it's cpu/mem usage) when you hover back over the window the mouse is invisible until you click in it again.

    I am guessing this is because it uses a custom mouse pointer and the event to re-show it is missed for some reason.

  • The mouse cursor is hidden by the CAP file, so there is no cursor displayed in the window, border included and if the window does not have the focus, no mouse message is sent.

  • Definitely going to need a dummied down example for me.

    Something without the function object would be nice.

  • Let me explain the example:

    First I set the plugin variables:

    Resources paths: Media/Demos/Demo_Themes;Media/Common/Demos;Media/Common/Themes

    The main resource file (with the main theme ): MyGUI_Core.xml

    Then the layouts (windows): Wallpaper.layout for the background, HelpPanel.layout for the top left window and Themes.layout for the main window.

    All this files are loaded at EditTime and at Runtime to render the layout.

    I create a private variable MainLayout which contains the layout of the main window (Themes.layout).

    Start of layout

    Step 7: I set the textbox called "Text" (described in HelpPanel.layout) with a caption. Then I create my demo window (call "CreateDemo").

    CreateDemo function with theme number to load as parameter:

    Step 8: First I unload the main window by calling "DestroyDemo".

    Step 9 to 11: depending on the value of function parameter, the main theme is changed by a load resource file.

    Step 12: I fill the entries of the combo box called "ComboBox" and set the index the same as the input parameter. I also set the ComboBox to be a drop box only with no edit field. Then I tell the ComboBox to react to "On accept" event with a "Set event". Some events have parameters. "On accept" has 2 parameters: sender (widget's name who sent the event) and index (the new selected index in the combo box). These parametes are retrieved using "GetEventParameter(paramNumber).

    DestroyDemo function

    Step 13: unload Themes.layout

    On ComboBox accept

    Step 14: I call CreateDemo with event parameter 1 which is the new selected index retrieved by "GetEventParameter(1)".

    I hope that will help to understand the demo a bit more

    By the way, GetEventParameter is zero-base indexed, shouldn't it be one-base indexed?

  • How do you correctly link a button to a regular event?

    I thought this would be a really simple task but after trying to link it with a simple event to show a hidden object it was not working. I tried a load of options also yet nothing worked.

    Also do you plan to make documentation/help for your object? I found loads of docs for the actual library and have been able to modify the XML and display that shows just fine but it's just the returning data back i am not having much success with.

    No included offline documentations is a general problem i am finding with this program though. For many things it's not much of a issue as they are self described/need no help but for the more complex plugins like this it would be a good idea i think.

  • How do you correctly link a button to a regular event?

    I thought this would be a really simple task but after trying to link it with a simple event to show a hidden object it was not working. I tried a load of options also yet nothing worked.

    Also do you plan to make documentation/help for your object?

    It's v0.02a man... he's just started working on this. Give it time

  • NO

    GIEF GUI

    NAO

    Nah, just keep the good work up

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's v0.02a man... he's just started working on this. Give it time

    Yeah i know, i wasn't asking for documents asap or anything, just wondering if they were planned for the future.

    It's great work so far though, i think i will be using this plugin a lot and it seems to allow every GUI element you could ever need.

  • Thank you all for giving support.

    About the documentation, I don't plan to create one as I won't have time to do it. But, if someone wants to build it, it would be great

    But I will translate all the MyGUI examples into CAP files.

  • How do you correctly link a button to a regular event?

    Button activation is done by widget mouse click. So, you set the event "On mouse button click" with the name of your widget then you add the condition "On Widget "name" mouse button click" to get the event.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)