Page 3 of 4

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Sat Mar 18, 2017 5:21 pm
by marauder2k9
I have this working completely in my game, the only problem is mouse actions don't do anything.

I used the gui from the documentation as an example just to try with creating my own model for the gui object and all that the text is supposed to change to hello world u know that one?

Well when the mouse interacts with the object the button changes states to being pressed but the text doesnt change furthermore when i load up the options dialog i cant interact with anything the crosshair shows up as designed but no drop down menu or anything like that shows

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Sat Mar 18, 2017 5:29 pm
by marauder2k9
An example of what i mean

Here u can see the gui in its default state
Image

then whenever u click the button
Image

it clearly changes but the text does not update.

Also do u think there is a way to get this to interact with key strokes? for typing in passwords and the like?

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Sun Mar 19, 2017 5:50 am
by Azaezel
Oddball. We use text on ours... I presume you're mapping the mat to the parent gui element?

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Sun Mar 19, 2017 5:48 pm
by marauder2k9
yea this is the full implementation in one material file for it:

Code: Select all

//--- OBJECT WRITE BEGIN --- %guiContent = new GuiControl(TestGui) { position = "0 0"; extent = "640 480"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; profile = "GuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; canSaveDynamicFields = "1"; new GuiWindowCtrl() { text = "Hello World"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "1"; canMaximize = "1"; canCollapse = "0"; edgeSnap = "1"; margin = "0 0 0 0"; padding = "0 0 0 0"; anchorTop = "1"; anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; position = "0 0"; extent = "630 463"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; profile = "GuiWindowProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; canSaveDynamicFields = "0"; new GuiButtonCtrl() { text = "Click Me"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; position = "139 207"; extent = "140 30"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; profile = "GuiButtonProfile"; visible = "1"; active = "1"; command = "lblHWDisplay.setValue(\"Hello World\");"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; canSave = "1"; canSaveDynamicFields = "0"; }; new GuiTextCtrl(lblHWDisplay) { text = " Waiting..."; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; anchorTop = "1"; anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; position = "68 127"; extent = "313 64"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; profile = "GuiBigTextProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; canSaveDynamicFields = "0"; }; }; }; //--- OBJECT WRITE END --- %guiContent = new GuiTextureCanvas(TestOffCanvas) { guiControl = "TestGui"; }; singleton Material(ScreenTest_ScreenMaterial) { mapTo = "ScreenMaterial"; diffuseMap[0] = "$guiTestOffCanvas"; materialTag0 = "GUIs"; };

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 2:05 am
by marauder2k9
ive added an echo to the default bind

Image

It seems to be definitely picking up the click its just not updating the gui

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 2:13 am
by Azaezel
Just to make sure I'm not going batshit here, did the sample https://github.com/Azaezel/Torque3D/com ... d8eee690R1 function, ors that acting up your end as well?

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 2:24 am
by marauder2k9
the example object and scrip doesnt interact at all, but heres the weird thing, when i clone ur github repo and build it, it all works but looks really funky, making the changes in 3.10rc2 it doesnt update the gui

Image

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 2:25 am
by Azaezel
OK, will try and dig on that some time this week.

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 3:04 am
by marauder2k9
okay this has me stumped, i copied all files that were changed into my code. the only file presenting a problem is guiCanvas.cpp

says cannot convert from const S32 to GuiControl

something must have been changed in gui canvas, im going to check the history of the file and see what changed

Re: guiDynamicTexture (GuiTextureCanvas) revisited

Posted: Tue Mar 21, 2017 3:35 am
by marauder2k9
okay changed

Code: Select all

DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (NULL), "(GuiControl ctrl=NULL)"
to

Code: Select all

DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (nullAsType<GuiControl*>()), "(GuiControl ctrl=NULL)"
builds now, but still no update to the gui