Giter Site home page Giter Site logo

temechon / bgui Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 7.0 2.05 MB

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

JavaScript 99.92% CSS 0.04% HTML 0.05%

bgui's People

Contributors

temechon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bgui's Issues

bug fix: pick invalid mesh

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.

Mesh trigger OnPointerOverTrigger not working?

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.

Question regarding more than one panel open in different positions

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.

Possible bug in Mesh scaling?

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.

Question regarding different panel shapes

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.

Animate alpha

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.

This is still useful! Reconsider deprecation?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.