Pastaspace Posted November 28, 2014 Share Posted November 28, 2014 Been messing around with 3.3, I noticed on the release page is says we can use the new Sprite class to easily make tracer rounds and laser beams, which sounds sweet. But uh, how would one go about doing this? The Sprite class doesn't seem to have any documentation yet. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 28, 2014 Share Posted November 28, 2014 It does: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/sprite/ Basically, just use SetSize() to make it really long and skinny, and then set the view mode to 6: http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/spritesetviewmode-r832 That will make it rotate around its own Z axis, so you just point the sprite entity wherever the laser beam should point and it will look right. This is how I did the bullet tracers in the FPS weapon model pack. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
randomkeyhits Posted November 28, 2014 Share Posted November 28, 2014 The sprite page under the command reference is empty. The user guide page looks like it should be a page that the empty command reference page would point to. I also can't find any reference in the user guide to sprites (I may well have missed it) so I can't see any other of the sprite functions. Quote content over form, game play over all. Link to comment Share on other sites More sharing options...
Thirsty Panther Posted November 28, 2014 Share Posted November 28, 2014 Look under documentation-index-sprite. Spritesetview mode http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/spritesetviewmode-r832 Spritegetview mode http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/sprite/spritegetviewmode-r833 Quote Link to comment Share on other sites More sharing options...
Josh Posted November 28, 2014 Share Posted November 28, 2014 Thanks for pointing that out. It was just a page permissions issue. You can access it now. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Pastaspace Posted November 28, 2014 Author Share Posted November 28, 2014 It does: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/sprite/ Basically, just use SetSize() to make it really long and skinny, and then set the view mode to 6: http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/spritesetviewmode-r832 That will make it rotate around its own Z axis, so you just point the sprite entity wherever the laser beam should point and it will look right. This is how I did the bullet tracers in the FPS weapon model pack. Alright, what are the rules for loading files in for sprites, just flat .mdl files? .tex files? Also it doesn't seem that the C++ class for sprite has a SetViewMode function. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted November 29, 2014 Share Posted November 29, 2014 It looks like you use Create with an Entity. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 30, 2014 Share Posted November 30, 2014 Prefabs can be saved from any object in the editor, including sprites. Or you can create a sprite in code. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.