Jump to content

Dragonfreak

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Dragonfreak

  1. Presume this is in visual studio? Considering all i have done so far is inside the leadwerks thing itself As i don't have the pro version upgrade (yet, really tempting to buy it... But money is a pain >_<) Tho, if this is possible even without the pro version, how exactly do i need to rebuild it? (Maybe noobish question, but my school barely thought my anything )
  2. I think it should ;o but eh, doesn't really matter anymore been so busy that I barely had time to check out the forums today >_< send my game in this afternoon and now got to create a presentation for Wednesday
  3. Complete spritesheet lua & shader + an example spritesheet on how it works Steps to follow: 1. Create a sprite in the scene. 2. Attach the Custom spritesheet.lua 3. Attach the "testing" material to it. 4. Run the game! Now, this is a very basic one. If you want to use an other spritesheet, all you have to do it change the Frame width & height in the Script tab (of 1 frame!!) And if you desire to change the speed, change the frame speed, this sets the actual speed at how fast the animation will go (the lower the number, the faster it goes ) And that's all to it! Enjoy Credits to shadmar's original spritesheet shader from his fire pit (I modified it slightly for this purpose) http://puu.sh/pLljg/40232be99f.zip
  4. How do ya mean exactly? Like exporting it for me into an exe or something? ;o
  5. Glad to hear mate! When I'm back on my laptop (within a few mins) I'll post the full solution here for anyone that also wants to achieve the same thing Since we changed some stuff
  6. Dragonfreak

    Steam Ratings

    I'll make sure my positive review will be there next week! Very awesome to read this progress you have made with this engine over the years Keep up the good work \o/
  7. Ah Oke, unfortunately I don't have that, but now I know at least! Thanks for the reply
  8. Goodday everyone! I have this random question which i have been wondering for a while now. Considering next week is my exams which i'll proudly show my created small game made with leadwerks Now the question, i noticed as soon as it gets standalone exported, it opens a console screen with the game. Now this isn't a huge problem.. But i think it'll look neater without I have tried to follow up this post a bit: http://www.leadwerks.com/werkspace/topic/6445-le3-hide-dos-screen/ However, i got a bit confused and it doesn't seem to work (Perhaps because it was le3 and not le4?) Anyone got any suggestion / tip / method for me to solve this? Thanks in advance!
  9. Haha, take your time That's one of the most important things And thanks can't wait to be done with my exams and just go on rampage with all the things i wanted to test haha
  10. I felt so bad that i almost forgot to post here again while i got home (My day has really been crazy and busy haha when i got home i just started playing a game and relax ) Eitherway! I promised a screenshot ^^ Now, this might not be the best screenshot but i suppose it does the trick You mostly need to look at the part where the origin of the beam is. I have checked this project again (been weeks that i have visited this due my exam project with the animated sprite sheet example that i posted earlier) and i noticed that i created the sprite inside the script. Spritesheet: When i first started making things in leadwerks i tended to do this to understand the lua scripting method a bit more. (if i explain it right hehe) Eitherway! To the point! I just realized by looking at my code.. That i used a different method for the sprite.. That is a bit embarrassing. But! I got my own solution (The shader i'm currently using is a small variation on the earlier mentioned of the shadmar's firepit which is mostly edited speed & images considering mine always needed to loop) Right, to get my piece of code; Option 1: -- Full spritesheet size Script.texture_W = 300 Script.texture_H = 100 -- Size of 1 frame Script.original_w = 50 Script.original_H = 50 -- Current Frame Position Script.currentAnim_X = 0 Script.currentAnim_Y = 0 Script.animate = false function Start() self.sprite = Sprite:Create() self.sprite_Material = Material:Load("*material name*.mat") self.sprite:SetMaterial(self.sprite_Material) local texture = self.sprite_Material:GetTexture() self.texture_W = texture:GetWidth() self.texture_H = texture:GetHeight() self.sprite.Shader = self.sprite_Material:GetShader() end function UpdateWorld() if window:KeyHit(Key.Space) then self.animate = true end if self.animate then self.currentAnim_X = Math:Inc((self.texture_W/self.original_W)-1,self.currentAnim_X,1) if self.currentAnim_X == (self.texture_W/self.original_W)-1 then self.animate = false -- I used this method to check if the animation reached the last spot of the spritesheet or not. If not, reset it to 0 on the next layer. If --yes, keep it at the end. self.currentAnim_X = (self.currentAnim_Y == 2 and (self.texture_W/self.original_W)-1 or 0) -- Check if this is on the last row of the animation, this can probably be done better but i have very limited time in my project hence -- the dirty way ( I would recommended checking the Height of your sheet and dividing it by the height of the frame ) if self.currentAnim_Y < 2 then self.currentAnim_Y = self.currentAnim_Y + 1 end end end self.shader_Spritesheet:SetVec2("uvcoords", Vec2(self.currentAnim_X,self.currentAnim_Y))--set uvcoords in shader self.shader_Spritesheet:SetVec2("zoom", Vec2(self.texture_W/self.original_W,self.texture_H/self.original_H))--set zoom in shader end With this method, you can use the whole spritesheet on a material so that you can attach it to a sprite (My mistake earlier! I thought it was a texture that was attached!) and then you can attach the shader of macklebee to the material. The code will get the shader from the material and use it's information to what it needs to do. #2: Another option is: (i would've loved to add it above in the code part aswell but i'm awful tired at 2:35 haha) This is similar to the above code, but instead you create the whole material inside the code and attach the texture + shader to it. This will only change the way and over complicate (in my opinion) it in the "Start()" function. Ofcourse, if this is what you desire, go nuts Yet another option that i thought up right now; You create the sprite in the editor itself, add the material that has the texture & shader attached (or well, you could not do that and go partly option 2 with over complicating inside the start script ) then you attach a Script that has the above method handling in the UpdateWorld() (Or, you could place it elsewhere, whatever you desire the most ofcourse) While having in the Start() the information of the texture a bit the same way we did above, but instead of loading a material, we'll just do "sprite_Material = self.entity:GetMaterial()" and the rest of the process would be pretty much the same. I hope i explained it enough this way i hope i didn't went overboard with my wall of text haha, i just like to be detailed and well, hopefully understandable ofcourse If there are any questions left, let me know and i'll try to reply ASAP! (This time for sure ) Another thing; Excuses if i might go a bit overboard with my "emoticons". I tend to use them alot, especially when i'm excited (see? There i go again haha) i try to reduce this to a minimum and not flooding the post with it
  11. Still at school aswell haha, waiting for the last conversation with my teacher I'll make screenshots of the sprite as soon as i get home Currently i got no mouse and my CTRL button is broken on my laptop which makes it pretty hard to do this haha. As far i know it should also still work, if i remember right i did this that exact way. I got the information which texture is on the sprite and then used the animating script on it. Another way which is possible, is just create the sprite object the way you want it and then attach the script to it and do all the texture from within the script and attach it to the sprite with self.entity:SetTexture(*texture*) So yes, that should work Edit: Fixed confusing typo
  12. I might be able to help you with this one, i also checked out the shadmar's firepit but considering i'm horrible with shaders just yet, it wasn't the best example to play with haha (it's still good! Don't get me wrong in that ) i did however found another post which is from macklebee which showed how to draw small parts from a texture. With this you can create your own "animation" function and sequence it in the way you like! I'm currently still at school and almost finished, when i get home i'll show you exactly what i mean For now, here is a link; http://www.leadwerks.com/werkspace/topic/12537-drawing-a-section-of-a-2d-texture-setting-uv-coords/#entry90453 This is currently my (messy?;P) code to animate it Script.original_W = 280/1.5 Script.original_H = 280/1.5 Script.texture_W = 280 Script.texture_H = 280 Script.screen_W = 600 Script.screen_H = 600 Script.animate = false Script.currentAnim_X = 0 Script.currentAnim_Y = 0 in start: self.soul_Essence_Anim = {} self.soul_Essence_Tex = Texture:Load("Materials/Hud/Soul Essence Anim2.tex") self.texture_W = self.soul_Essence_Tex:GetWidth()/1.5 self.texture_H = self.soul_Essence_Tex:GetHeight()/1.5 in updateWorld() if self.animate and not upgradeScreen and not paused then self.currentAnim_X = Math:Inc((self.texture_W/self.original_W)-1,self.currentAnim_X,1) if self.currentAnim_X == (self.texture_W/self.original_W)-1 then self.animate = false self.currentAnim_X = (self.currentAnim_Y == 2 and (self.texture_W/self.original_W)-1 or 0) if self.currentAnim_Y < 2 then self.currentAnim_Y = self.currentAnim_Y + 1 end end end in the postrender stuff self.shader_Spritesheet:SetVec2("uvcoords", Vec2(self.currentAnim_X,self.currentAnim_Y))--set uvcoords in shader self.shader_Spritesheet:SetVec2("zoom", Vec2(self.texture_W/self.original_W,self.texture_H/self.original_H))--set zoom in shader Short explanation: self.texture_W and _H get the current full texture size with all the animated sequences in. self.original_W and _H are the size of the actual picture you want to animate. currentAnim_X goes through the horizontal animation and currentAnim_Y goes through the vertical one. What i did here is pretty much first go through the first set of animation then set it to the second row and do the same and so on. My animated spritesheet: I actually went on way longer then intended haha, i hope this helps somewhat with your current question Let me know if you need more information and i'll come back at you as soon i get home! Goodluck EDIT: In this example i mostly focused on the 2D screen draw, but this is also usable on sprites! When i'm home i'll give you an example that i made with the sprite ^^
  13. That is actually a good idea ;o i might fiddle around with that, perhaps i can shuffle around the textures a bit and get it sort of "animated"! People are still welcome for suggestions! I would love to try em all out
  14. Heey everyone First time on the forums First of all, i love this engine and it really motivated me back into programming (due my horrible school study i really lost hope in it T_T) Now to the point I have recently created a skybox, with a simple tool. But i was wondering if it was possible to animate this? I'm horrible with searching around on forums & google regarding leadwerks (in general usually ;P) which is the reason i felt like just asking it If it isn't possible, it's also cool! Because i like the way in it's current state, but a lil extra favor can never hurt Side note: I'm developing a game for my Exam project, so this could add a nice extra point ^^ Thanks in advance! ~Dragonfreak skybox currently using:
×
×
  • Create New...