Jump to content

Best Method for RPG Style Point/DMG Floating Prompts


Pryme8
 Share

Recommended Posts

So Im sure everyone knows the DPS Messages from most RPG's.

Where you hit something and text pops out and fades off showing a value of that event.

So this is a two part question...  Do we support Image Textmaps, if not then does anyone have any examples of image text that they have worked up.

Second part would be with the scene already having one AdvanceDynamicTexture for the UI, what would be the best method of displaying this info? 

Maybe a dynamic texture that updates the value being displayed then, create a billboard plane that holds a cloned version of the dynamic texture on it, animate the plane and then dispose them both after the animation is done?

Link to comment
Share on other sites

	var makeTextPlane =
		function(text, color, size)
		{
			var dynamicTexture = new BABYLON.DynamicTexture("DynamicTexture", 50, scene, true);
			dynamicTexture.hasAlpha = true;
			dynamicTexture.drawText(text, 5, 40, "bold 36px Arial", color , "transparent", true);

			var plane = new BABYLON.Mesh.CreatePlane("TextPlane", size, scene, true);
			plane.material = new BABYLON.StandardMaterial("TextPlaneMaterial", scene);
			plane.material.backFaceCulling = false;
			plane.material.specularColor = new BABYLON.Color3(0, 0, 0);
			plane.material.diffuseTexture = dynamicTexture;

			return plane;
		};

Something like this?

Edited by QuintusHegie
had a fight with the code editor syntax coloring ;-)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...