### guiDynamicTexture (GuiTextureCanvas) revisited

Scripts and codes that enhances or changes the GUI in the engine.

#### guiDynamicTexture (GuiTextureCanvas) revisited

Azaezel
Posts: 395
Joined: Tue Feb 03, 2015 9:50 pm

Repost for http://www.garagegames.com/community/fo ... ead/140997 since that got burried in spam:

So. Full disclosure right off the bat, I'm an Awesomium Integration Kit owner ( you can get that here: www.gameinprogress.com/ ), and I highly recommend using that if you can, because it's both cleaner and more flexible. That being said, for quick prototyping, and testing that kind of thing vs development head to make sure changes don't break things, a variant on www.garagegames.com/community/resource/view/10899 can be found github.com/Azaezel/Torque3D/tree/guiOnObject. As I do clearly have a conflict of interest in further alterations, any suggested changes and/or calls for submission to development head will be based purely on this thread.

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

J0linar
Posts: 46
Joined: Thu Feb 05, 2015 8:50 pm
am a awesomium guy too but i find the guionobject to be really helpfull in some areas, lets say you want to display a 3d model and combine that with a loadout or simply simulate computer screens ingame, or as a ingame menu, for that kind of stuff (as long as you dont attempt to build a whole menu with it)
the guionobject is perfect.

Now as am using it in my current wip game,
some tips for ppl who plan to use this
• 1 gui on 1 guionobject model

only 1 GuiWindowCtrl can be run in a guionobject model (it might be possible to build a gui with multiple guiwindowctrls and executing those via setWindow(); but so far i have no clue how to get that working)

- If you want to build a whole menu in one gui then take a look at the optionsDlg.gui located in game/art/gui, you can build a whole menu in one gui by using panes.

So far i havent found any issues related to the gui itself and it would be nice to see this in the upcoming T3D 3.7 release, it would serve as a promo for awesomium as well, since ppl who wish more functionality would want to get awesomium.

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

MangoFusion
Posts: 50
Joined: Wed Feb 04, 2015 12:00 am
For reference I had to make my own Offscreen Canvas implementation in the Oculus Rift 2 branch to display dialogs. i.e. https://github.com/jamesu/Torque3D/blob ... Canvas.cpp

Definitely something which should be incorporated in some form into stock T3D.

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

chriscalef
Posts: 375
Joined: Mon Feb 09, 2015 7:48 pm
Speaking of Awesomium, is it still an active thing? I thought I heard it had dropped off the map or diminished in importance. I'm still using it, but would love to switch to something more mainstream and especially open source, which brings to mind, has anyone tried or know anyone who has tried WebKit?

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
I have this working in tandem with fxGuiSnooper, to show security camera feeds on an object.

Works flawlessly for that... However now that I am running 64-bit and can no longer use Awesomium, I am trying to move some of my GUIs onto objects to replace the Awesomium functionality.

I can get the GUIs to pop on there fine, just as they do with the fxGuiSnooper, but I do not have any mouse control on the GUIs. Is this normal? Anything I may be missing in the code that would enable that?

Thanks!

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

Azaezel
Posts: 395
Joined: Tue Feb 03, 2015 9:50 pm

You should indeed have mouse icon display...

Direct dump from the personal game using it at present:

Code: Select all

new GuiTextureCanvas( MonitorCanvas ) { guiControl = "upgradeGUI"; cursorBitmap = "art/gui/weaponHud/use.png"; }; singleton Material(ScreensMaterial2) { mapTo = "monitorMat"; diffuseMap[0] = "art/gui/upgradeIcons/background.png"; diffuseMap[1] = "$guiMonitorCanvas"; emissive[0] = "0"; materialTag0 = "GUIs"; emissive[1] = "1"; diffuseColor[0] = "0.992157 0.992157 0.992157 1"; glow[0] = "0"; specular0 = "0.125 0.125 0.125 1"; specularPower0 = "50"; animFlags[0] = "0x0000000c"; scrollDir[0] = "0 0"; scrollSpeed[0] = "0"; waveType[0] = "Triangle"; waveFreq[0] = "1"; waveAmp[0] = "1"; metalness[0] = "1"; };  If you don't feed it one, it'll default to https://github.com/Azaezel/Torque3D/com ... f8560d7R48 For clicking, there's: Code: Select all function mouseFire(%val) { if ($guiCanvas::Interact) { %guitarg = $guiCanvas::InteractingWith; if (%val) %guitarg.doMouseClick($guiCanvas::PosX,$guiCanvas::PosY); return; }$mvTriggerCount0++; } 
and you can follow the source-alts:
https://github.com/Azaezel/Torque3D/com ... 8560d7R298 for tracking how those vars are handled.

That clarify things any?

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
That's awesome, thanks!

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

J0linar
Posts: 46
Joined: Thu Feb 05, 2015 8:50 pm
Hey Paul,
would you mind sharing your method on how you got it working with the fxGuiSnooper?

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

Timmy
Posts: 351
Joined: Thu Feb 05, 2015 3:20 am
Awesome work az, i find the big problem with awesomium is the lack of 64bit on windows. Pretty restricting really.

#### Re: guiDynamicTexture (GuiTextureCanvas) revisited

PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
Sure, to get this working with fxGuiSnooper, you need a few things:

- A camera object (can be anything really, we use a transparent cube)
- A viewer object (set up with a mapped material to a GuiTextureCanvas)
- A GUI Control somewhere (we put one in the PlayGui) that will be mapped on to that viewer object... Within that Gui Control you should also have an fxGuiSnooper set up that points to the camera object

Then when the viewer object appears, it should be textured with that Gui Control, and the fxGuiSnooper nested inside that control should be active and should display the view from the camera object.

We got a bit more complicated than that, for example we have multiple cameras and our viewer cycles through them every 15 seconds, but with the basics above you should be able to get it working.

Let me know if I missed anything.

Cheers
P

My game-specific code below for reference:

Code: Select all

 ******************************************** Playgui.gui: new GuiControl(FeedOneDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; horizSizing = "center"; vertSizing = "center"; profile = "GuiOverlayProfile"; visible = "0"; active = "0"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; hidden = "1"; canSave = "1"; canSaveDynamicFields = "1"; fixedAspectRatio = "0"; new fxGuiSnooper(FeedOneDlgObj) { cameraZRot = "0"; forceFOV = "0"; reflectPriority = "1"; renderStyle = "standard"; margin = "0 0 0 0"; padding = "0 0 0 0"; anchorTop = "1"; anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; position = "15 5"; extent = "1000 760"; minExtent = "8 2"; horizSizing = "center"; vertSizing = "center"; profile = "GuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; canSaveDynamicFields = "0"; ViewRotation = "0 0 0"; ViewOffset = "0 0 0"; FOV = "60"; SweepAmplitude = "0 0 45"; SweepTime = "25000 25000 25000"; AttachedObject = "Cam1"; OverlayBitmap = "0"; OverlayTile = "0"; OverlayColour = "0"; ColorOverlay = "1 1 1 0.5"; RedMask = "1"; GreenMask = "1"; BlueMask = "1"; }; }; ******************************************** materials.cs file in the folder with my viewer object (object filename FeedOneGui.dae, material name within is FeedOneGui): new GuiTextureCanvas( FeedOneCanvas ) { guiControl = "FeedOneDlg"; }; new Material(GuiFeedOneMat) { diffuseMap[0] = "\$guiFeedOneCanvas"; emissive[0] = true; mapTo = "FeedOneGui"; }; ******************************************** Camera object to put in mission file: new StaticShape(cam1) { isAIControlled = "0"; dataBlock = "SecurityCameraInvisibleData"; position = "-240 63 120"; rotation = "1 0 0 15"; scale = "1 1 1"; isSTControl = "0"; canSave = "1"; canSaveDynamicFields = "1"; }; And the datablock for that camera (just an invisible object): datablock StaticShapeData(SecurityCameraInvisibleData) { // Basic Item properties shapeFile = "art/Camera/SpyCamNm.dts"; scale = "2 0.5 1"; mass = 2; friction = 1; elasticity = 0.3; emap = true; }; 

#### Who is online

Users browsing this forum: No registered users and 0 guests