temechon / bgui Goto Github PK
View Code? Open in Web Editor NEWA Babylon.js extension to create a game GUI
Home Page: http://temechon.github.io/bGUI/
License: Do What The F*ck You Want To Public License
A Babylon.js extension to create a game GUI
Home Page: http://temechon.github.io/bGUI/
License: Do What The F*ck You Want To Public License
bug fix: if there are more mesh picked, GUISystem.enableClick() will
result in all mesh be picked. in actually, GUISystem.enableClick should
pick only 2D bGUI mesh.
The link to the documentation is dead : http://doc.babylonjs.com/page.php?p=25102
Hi Temechon,
I was looking at making a GUIPanel do something when a mouse rolls over it. I notice u use an onClick
function:
var vault = new bGUI.GUIPanel("boy", assets["vault11"], null, gui);
vault.relativePosition(new BABYLON.Vector3(0.5,0.85,0));
vault.onClick = function() {
animateTest(boy.mesh, 60); // boy = new bGUI.GUIPanel(...)
};
This is great, however I thought I could get at the mesh
property and use the ActionManager
and have the triggers OnPointerOverTrigger
and OnPointerOutTrigger
and all that wonderful Babylon stuff at:
http://doc.babylonjs.com/tutorials/How_to_use_Actions
I tried a simple example with a normal Mesh using Babylon and the OnPointerOverTrigger
worked.
I tried a simple example with the Mesh from GUIPanel and the OnPointerOverTrigger
didn't seem to trigger.
Is the OnPointerOverTrigger
and OnPointerOutTrigger
supported? Will there be an onPointerOver
and onPointerOut
event?
Thanks again,
bws.
Hello,
How do i place a GUI panel (guiPanelA) immediately to the right of another GUI panel (guiPanelB) when the original GUI panel (guiPanelB) is not know until run-time?
For example, guiPanelB will fade-in when the mouse rolls over a texture. At the same time, I want guiPanelA to fade in immediately to the right of it. I'm trying to create a tabed-like menu system.
If i could get the exact pixel location for the edge of a GUIPanel, and be able to place a GUIPanel at a pixel location, this might help me. But I've been playing around with
var weaponsSize = myGuiPanel.mesh.getBoundingInfo().boundingBox.extendSize;
console.log(weaponsSize);
but this does not seem to work.
Any ideas?
Thanks,
bws.
Hi there,
There may possibly be a bug in the mesh scaling in bGUI as I seem to be having an issue with the GUIPanel/GUIText.
In a normal Babylon mesh, I can do scaling like:
myMesh.scaling = new BABYLON.Vector3( 2, 2, 2 ); // will double the size of the mesh
...but in a GUIPanel, when I do:
myGUIPanel.mesh.scaling = new BABYLON.Vector3( 2, 2, 2 );
nothing seems to appear.
I notice when I go:
myGUIPanel.mesh.scaling = new BABYLON.Vector3( 100, 100, 100 );
it does appear (albeit smaller), and when I do:
myGUIPanel.mesh.scaling = new BABYLON.Vector3( 200, 200, 200 );
it is even bigger.
Is this a bug and can it be looked into, or is there another way to do it for the GUIPanel/GUIText ?
Thanks muchly again,
bws.
Hi,
Is there a way (in GIUObject, for example) a way of defining non-rectangular shapes for a GUIPanel (like a rectangle with a small section jutting out?).
Another question: is there a way of hit testing with mouseover where on the GUIPanel the mouse currently is? the reason is I'm wanting to emulate a menu where the buttons will change slightly when the mouse rolls over it.
Thanks again,
bws.
Hi there,
I'm trying to 'fade-out' the GUIPanel 'boy' in the example by applying an animation to the Mesh.
I have modified the 'animate' function in 'index.js' to be:
BABYLON.Animation.CreateAndStartAnimation("", mesh, "material.alpha", 15, fps, 1.0, 0.0, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
(note I'm modifying the alpha from 1.0 to 0.0)
... and the image DOES fade out, however as soon as the animation begins, a black rectangle appears 'behind?' the image, and slowly fades out with the image. What is this black rectangle, and how do i get rid of it? (viewed in Chrome and Firefox latest versions)
On another related matter, your Roadmap for v1.3 suggests putting in animation effects on GUIPanel (which is great!), but my question is that if we can get at the mesh (via the GUIPanel.Mesh property), can't we just use the standard Babylon animation features?
Cheers.
@Temechon - Just wondering if you would ever re-consider deprecation of this project.
WebGL GUI controls are still very useful even in a world where there are 2d canvas APIs. There are optimizations and uses-cases that require many projects to only leverage a single canvas, which means drawing game logic and the GUI all into one 3d canvas.
Happy to run off and fork this, but would love to see contributors rally around the original project. Thanks for all of your work here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.