Re: Creating Animated GUI?

#2
First you need to install a professional animating program like Fragmotion. I suggest getting Fragmotion if you want to add new npc's because that's the probram that extraxts b3d files witch are needed for entities in the game. Fragmotion says that it isnt free but you have the full version even if you get the trial version. You have to take this thing where you type out the fathers prayer and you get the program for 7 days. Once it expires, it will let you do it again and use the full version for another 7 days.

Learn how to use the program, start out with a simple cylinder then you want to give it bones, pivot points that allows the character to move or bend in certain directions. Then you animate it.

I will tell you this it is not easy, and it is time consuming and complicated, but its cool once you get to know how to do it.

Re: Creating Animated GUI?

#4
bladestorm wrote:oh wait you said animated GUI my mistake
You could've simply deleted your post (I believe) instead of making a second one just to say that you did a mistake.
Do you think NASA invented thunderstorms to cover up the sound of space battles?

Re: Creating Animated GUI?

#5
Find an image or make one that is like this, where each frame is in the same image and is the same distance apart each time:
Image
Let's say you want to use this to replace the blink icon. You'd go into the code and find where it loads the blink icon, and change the line of code from "LoadImage" to "LoadAnimImage", changing the variables to match the new image. In this case, you would also need to blend the image to remove the pink. I can't remember if the function is EntityBlend or BlendImage or ImageBlend or whatever. I'm sure a quick CTRL+F of Main.bb will yield something.

Then you'd have to make a loop to animate it in the function where the blink icon is drawn.

Code: Select all

If MilliSecs() > tmrSparks + 100 Then
tmrSparks=MilliSecs() ; 'reset' the timer
frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are  out
End If 
DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
(taken from http://www.blitzbasic.com/b3ddocs/command.php?name=LoadAnimImage)
Essentially you would adapt this; you declare tmr/frmSparks to be local to the DrawGUI function, then at the DrawImage for the blink icon, you'd add an extra variable to the end: "frmSparks" which would animate it.
SCP - Box of Horrors v0.8.0b
Twitter
Github Profile

Re: Creating Animated GUI?

#6
InnocentSam wrote:... In this case, you would also need to blend the image to remove the pink. I can't remember if the function is EntityBlend or BlendImage or ImageBlend or whatever. ...
It's MaskImage.

Also, Blitz3D images aren't very good for this. They're easy to use, but they can be slow and look ugly. Using a camera with orthographic projection and a sprite with an animated texture allows antialiasing, alpha channels and many other effects.

Re: Creating Animated GUI?

#7
InnocentSam wrote:Find an image or make one that is like this, where each frame is in the same image and is the same distance apart each time:
Image
Let's say you want to use this to replace the blink icon. You'd go into the code and find where it loads the blink icon, and change the line of code from "LoadImage" to "LoadAnimImage", changing the variables to match the new image. In this case, you would also need to blend the image to remove the pink. I can't remember if the function is EntityBlend or BlendImage or ImageBlend or whatever. I'm sure a quick CTRL+F of Main.bb will yield something.

Then you'd have to make a loop to animate it in the function where the blink icon is drawn.

Code: Select all

If MilliSecs() > tmrSparks + 100 Then
tmrSparks=MilliSecs() ; 'reset' the timer
frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are  out
End If 
DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
(taken from http://www.blitzbasic.com/b3ddocs/command.php?name=LoadAnimImage)
Essentially you would adapt this; you declare tmr/frmSparks to be local to the DrawGUI function, then at the DrawImage for the blink icon, you'd add an extra variable to the end: "frmSparks" which would animate it.
you see i know almost othing about coding

Re: Creating Animated GUI?

#10
bladestorm wrote:Can't you just create a gif image? Since they are the images that animate.
No, while gifs usually have multiple 'frames' within the file itself, they cannot animate themselves. The reason why lots of people believe what you believe is that they only view gifs in a browser or specialized image viewer that handles the animation. That being said, for the love of god, don't use gifs for something like this. It'd be much easier to make a sprite sheet and blit rectangles from it. Frankly, I can't remember how efficient B3D's sprites are, but provided you implement it properly you should be fine.
Last edited by MonocleBios on Sat May 31, 2014 6:44 pm, edited 1 time in total.
M-x dingus-mode
cron