sglorz's Forum Posts

  • I see how to create the condition but you make it sound like it needs 2, so a sub event is needed also?

    No, only one condition. Why a sub event ?

    Also where do you find the widget names needed because after looking at the layout it seems they would be "Button", "CheckBox" or "RadioButton" etc but these don't work.

    It sounds really simple but for some reason nothing will work, could you make a simple cap example if possible?

    All widgets name are defined in the ".layout" file or when creating it in cap file.

  • Ok, I see exactly what you mean, the progress bar is redrawn every call to step as the tiled background waits to leave the loop for being redrawn.

    I have to look into this as like all Construct plugins, drawing is called after finishing events, so CGUI is updating only at this time.

  • What do you mean by frame rate independant?

  • 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.

  • 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.

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.
  • 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]
  • I cannot get this to run, i have updated the Input System plugin also and that works great. The error given is -

    Error loading E:\Program Files\Scirra\Construct\Plugins\CGUI.csx (126) - this plugin may not be available!

    My guess to the reason why is because my default drive is not C:\ and this is using some sort of required location. All other addon objects i have tried seem to work fine also so if that is not the reason i have no idea why else it would be.

    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)?

  • Why not make both available?

    Why not, but I will have to manage two different plugins, with risks and problems of synchronisation.

    Question is, will we have to have anything else loaded from an external source?

    Like the media folder, xml, etc.

    We do have the Resource plugin that could handle externals.

    MyGUI has a complete resources management. My idea is to let it as it is and to add a bridge between Construct and MyGUI, e.g. import Construct objects like Sprite.

  • I agree too, so I'll keep it like that.

  • I have a small question about MyGUI integration.

    There is 2 manners to integrate it:

    • directly in csx file with the sources (as now)
    • using an external dll, which implies that games using CGUI must include MyGUI.dll.

    What do you prefer?

  • Thanks for the support, it always helps

  • Ok, I've tested your example, and It worked!

    I will publish a new version shortly, as soon as I've corrected some strange glitches...