home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 July
/
CMCD0704.ISO
/
Software
/
Freeware
/
Grafica
/
Animation
/
AnimationStudioSetup.msi
/
_3CA7015D32004C8B8FAB422593C47FB8
/
_1EAAC8144BD160C6362DABED629B9A24
< prev
next >
Wrap
Text File
|
2004-05-24
|
15KB
|
413 lines
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Tutorial_2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AnimationStudio.SpritePanel spritePanel1;
private System.Windows.Forms.RichTextBox richTextBox1;
private AnimationStudio.Sprite sprite1;
private AnimationStudio.KeyFrame keyFrame1;
private AnimationStudio.KeyFrame keyFrame2;
private AnimationStudio.KeyFrame keyFrame3;
private AnimationStudio.KeyFrame keyFrame4;
private AnimationStudio.Sprite sprite2;
private AnimationStudio.KeyFrame keyFrame5;
private AnimationStudio.KeyFrame keyFrame6;
private AnimationStudio.Sprite sprite3;
private AnimationStudio.KeyFrame keyFrame7;
private AnimationStudio.KeyFrame keyFrame8;
private AnimationStudio.Sprite sprite4;
private AnimationStudio.KeyFrame keyFrame9;
private AnimationStudio.KeyFrame keyFrame10;
private AnimationStudio.KeyFrame keyFrame11;
private AnimationStudio.KeyFrame keyFrame12;
private AnimationStudio.KeyFrame keyFrame13;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
AnimationStudio.Sound sound1 = new AnimationStudio.Sound();
AnimationStudio.Sound sound2 = new AnimationStudio.Sound();
AnimationStudio.Sound sound3 = new AnimationStudio.Sound();
AnimationStudio.Sound sound4 = new AnimationStudio.Sound();
this.spritePanel1 = new AnimationStudio.SpritePanel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.sprite1 = new AnimationStudio.Sprite(this.spritePanel1);
this.keyFrame1 = new AnimationStudio.KeyFrame();
this.keyFrame2 = new AnimationStudio.KeyFrame();
this.keyFrame3 = new AnimationStudio.KeyFrame();
this.keyFrame4 = new AnimationStudio.KeyFrame();
this.sprite2 = new AnimationStudio.Sprite(this.spritePanel1);
this.keyFrame5 = new AnimationStudio.KeyFrame();
this.keyFrame6 = new AnimationStudio.KeyFrame();
this.sprite3 = new AnimationStudio.Sprite(this.spritePanel1);
this.keyFrame7 = new AnimationStudio.KeyFrame();
this.keyFrame8 = new AnimationStudio.KeyFrame();
this.sprite4 = new AnimationStudio.Sprite(this.spritePanel1);
this.keyFrame9 = new AnimationStudio.KeyFrame();
this.keyFrame10 = new AnimationStudio.KeyFrame();
this.keyFrame11 = new AnimationStudio.KeyFrame();
this.keyFrame12 = new AnimationStudio.KeyFrame();
this.keyFrame13 = new AnimationStudio.KeyFrame();
this.spritePanel1.SuspendLayout();
this.SuspendLayout();
//
// spritePanel1
//
this.spritePanel1.BackColor = System.Drawing.Color.DarkGray;
this.spritePanel1.Controls.Add(this.richTextBox1);
this.spritePanel1.Location = new System.Drawing.Point(8, 8);
this.spritePanel1.Name = "spritePanel1";
this.spritePanel1.Size = new System.Drawing.Size(672, 520);
this.spritePanel1.Sprites.AddRange(new AnimationStudio.Sprite[] {
this.sprite1,
this.sprite2,
this.sprite3,
this.sprite4});
this.spritePanel1.TabIndex = 0;
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.LightSkyBlue;
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.richTextBox1.ForeColor = System.Drawing.Color.Black;
this.richTextBox1.Location = new System.Drawing.Point(216, 296);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.richTextBox1.ShowSelectionMargin = true;
this.richTextBox1.Size = new System.Drawing.Size(448, 216);
this.richTextBox1.TabIndex = 3;
this.richTextBox1.Text = @"1) Change the properties of the Sprites, Timeline and KeyFrames
2) Watch the result of all changes in realtime in the designer
3) Compile and run the example
Key Features of Sprites:
1) Display as Image or Text Sprite
2) Make regions of a Sprite transparent (Transparent color)
3) Move Sprites along Path's
4) Change Size, Rotation, Opacity, Position, Z-Order between KeyFrames
5) Draw Borders around Sprites
4) Detect Collisions and other events (See events and Tutorial 3)
5) Change all Properties directly in the Designer without compiling
6) Play Sounds at defined Events
Open Tutorial 3";
//
// sprite1
//
this.sprite1.BorderColor = System.Drawing.Color.WhiteSmoke;
this.sprite1.BorderWidth = 2F;
this.sprite1.DrawBorder = false;
this.sprite1.DrawText = true;
this.sprite1.Font = new System.Drawing.Font("Arial", 30F, System.Drawing.FontStyle.Bold);
this.sprite1.Image = ((System.Drawing.Bitmap)(resources.GetObject("sprite1.Image")));
this.sprite1.PathClosed = true;
this.sprite1.Position = new System.Drawing.Point(298, 51);
this.sprite1.Rotation = 324F;
this.sprite1.Size = new System.Drawing.Size(331, 271);
sound1.SoundFile = "";
this.sprite1.Sound = sound1;
this.sprite1.Text = "Text Sprite";
this.sprite1.TextColor = System.Drawing.Color.WhiteSmoke;
this.sprite1.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
this.keyFrame1,
this.keyFrame2,
this.keyFrame3,
this.keyFrame4});
this.sprite1.TransparentColor = System.Drawing.Color.Black;
this.sprite1.XScale = 1.55F;
this.sprite1.YScale = 1.55F;
//
// keyFrame1
//
this.keyFrame1.Duration = 60;
this.keyFrame1.Opacity = 1F;
this.keyFrame1.Position = new System.Drawing.Point(295, 234);
this.keyFrame1.Rotation = 0F;
this.keyFrame1.Visible = true;
this.keyFrame1.XScale = 1;
this.keyFrame1.YScale = 1;
this.keyFrame1.ZOrder = 0;
//
// keyFrame2
//
this.keyFrame2.Duration = 60;
this.keyFrame2.Opacity = 0F;
this.keyFrame2.Position = new System.Drawing.Point(646, 384);
this.keyFrame2.Rotation = 0F;
this.keyFrame2.Visible = true;
this.keyFrame2.XScale = 1;
this.keyFrame2.YScale = 1;
this.keyFrame2.ZOrder = 0;
//
// keyFrame3
//
this.keyFrame3.Duration = 60;
this.keyFrame3.Opacity = 1F;
this.keyFrame3.Position = new System.Drawing.Point(452, 35);
this.keyFrame3.Rotation = 0F;
this.keyFrame3.Visible = true;
this.keyFrame3.XScale = 2;
this.keyFrame3.YScale = 2;
this.keyFrame3.ZOrder = 0;
//
// keyFrame4
//
this.keyFrame4.Duration = 60;
this.keyFrame4.Opacity = 1F;
this.keyFrame4.Position = new System.Drawing.Point(6, 68);
this.keyFrame4.Rotation = 720F;
this.keyFrame4.Visible = true;
this.keyFrame4.XScale = 1;
this.keyFrame4.YScale = 1;
this.keyFrame4.ZOrder = 0;
//
// sprite2
//
this.sprite2.BorderColor = System.Drawing.Color.WhiteSmoke;
this.sprite2.BorderWidth = 2F;
this.sprite2.DrawBorder = false;
this.sprite2.DrawPath = false;
this.sprite2.DrawText = false;
this.sprite2.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold);
this.sprite2.Image = ((System.Drawing.Bitmap)(resources.GetObject("sprite2.Image")));
this.sprite2.PathClosed = true;
this.sprite2.Position = new System.Drawing.Point(32, 339);
this.sprite2.Rotation = 183.6667F;
this.sprite2.Size = new System.Drawing.Size(110, 85);
sound2.SoundFile = "";
this.sprite2.Sound = sound2;
this.sprite2.Text = "Sprite";
this.sprite2.TextColor = System.Drawing.Color.DarkRed;
this.sprite2.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
this.keyFrame5,
this.keyFrame6});
this.sprite2.TransparentColor = System.Drawing.Color.Transparent;
this.sprite2.XScale = 1.033333F;
this.sprite2.YScale = 1.033333F;
//
// keyFrame5
//
this.keyFrame5.Duration = 100;
this.keyFrame5.Opacity = 1F;
this.keyFrame5.Position = new System.Drawing.Point(614, 44);
this.keyFrame5.Rotation = 0F;
this.keyFrame5.Visible = true;
this.keyFrame5.XScale = 2;
this.keyFrame5.YScale = 2;
this.keyFrame5.ZOrder = 0;
//
// keyFrame6
//
this.keyFrame6.Duration = 150;
this.keyFrame6.Opacity = 1F;
this.keyFrame6.Position = new System.Drawing.Point(12, 349);
this.keyFrame6.Rotation = 190F;
this.keyFrame6.Visible = true;
this.keyFrame6.XScale = 1;
this.keyFrame6.YScale = 1;
this.keyFrame6.ZOrder = 0;
//
// sprite3
//
this.sprite3.BorderColor = System.Drawing.Color.WhiteSmoke;
this.sprite3.BorderWidth = 2F;
this.sprite3.DrawBorder = false;
this.sprite3.DrawPath = false;
this.sprite3.DrawText = false;
this.sprite3.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold);
this.sprite3.Image = ((System.Drawing.Bitmap)(resources.GetObject("sprite3.Image")));
this.sprite3.Opacity = 0.62F;
this.sprite3.PathClosed = true;
this.sprite3.Position = new System.Drawing.Point(310, 186);
this.sprite3.Rotation = 136.8F;
this.sprite3.Size = new System.Drawing.Size(217, 217);
sound3.SoundFile = "";
this.sprite3.Sound = sound3;
this.sprite3.Text = "Sprite";
this.sprite3.TextColor = System.Drawing.Color.DarkRed;
this.sprite3.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
this.keyFrame7,
this.keyFrame8});
this.sprite3.TransparentColor = System.Drawing.Color.Transparent;
this.sprite3.XScale = 0.81F;
this.sprite3.YScale = 0.81F;
this.sprite3.ZOrder = 3;
//
// keyFrame7
//
this.keyFrame7.Duration = 100;
this.keyFrame7.Opacity = 1F;
this.keyFrame7.Position = new System.Drawing.Point(310, 186);
this.keyFrame7.Rotation = 0F;
this.keyFrame7.Visible = true;
this.keyFrame7.XScale = 1;
this.keyFrame7.YScale = 1;
this.keyFrame7.ZOrder = 3;
//
// keyFrame8
//
this.keyFrame8.Duration = 100;
this.keyFrame8.Opacity = 0F;
this.keyFrame8.Position = new System.Drawing.Point(310, 186);
this.keyFrame8.Rotation = 360F;
this.keyFrame8.Visible = true;
this.keyFrame8.XScale = 0.5;
this.keyFrame8.YScale = 0.5;
this.keyFrame8.ZOrder = 3;
//
// sprite4
//
this.sprite4.BorderColor = System.Drawing.Color.WhiteSmoke;
this.sprite4.BorderWidth = 2F;
this.sprite4.DrawBorder = false;
this.sprite4.DrawText = false;
this.sprite4.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold);
this.sprite4.Image = ((System.Drawing.Bitmap)(resources.GetObject("sprite4.Image")));
this.sprite4.PathClosed = true;
this.sprite4.PathForm = AnimationStudio.PathFormEnumeration.linear;
this.sprite4.Position = new System.Drawing.Point(99, 223);
this.sprite4.Rotation = 187.5F;
this.sprite4.Size = new System.Drawing.Size(57, 57);
sound4.SoundFile = "";
this.sprite4.Sound = sound4;
this.sprite4.Text = "Sprite";
this.sprite4.TextColor = System.Drawing.Color.DarkRed;
this.sprite4.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
this.keyFrame9,
this.keyFrame10,
this.keyFrame11,
this.keyFrame12,
this.keyFrame13});
this.sprite4.TransparentColor = System.Drawing.Color.Black;
this.sprite4.XScale = 1F;
this.sprite4.YScale = 1F;
this.sprite4.ZOrder = 4;
//
// keyFrame9
//
this.keyFrame9.Duration = 32;
this.keyFrame9.Opacity = 1F;
this.keyFrame9.Position = new System.Drawing.Point(392, 219);
this.keyFrame9.Rotation = 1000F;
this.keyFrame9.Visible = true;
this.keyFrame9.XScale = 1;
this.keyFrame9.YScale = 1;
this.keyFrame9.ZOrder = 4;
//
// keyFrame10
//
this.keyFrame10.Duration = 32;
this.keyFrame10.Opacity = 1F;
this.keyFrame10.Position = new System.Drawing.Point(100, 461);
this.keyFrame10.Rotation = 0F;
this.keyFrame10.Visible = true;
this.keyFrame10.XScale = 1;
this.keyFrame10.YScale = 1;
this.keyFrame10.ZOrder = 4;
//
// keyFrame11
//
this.keyFrame11.Duration = 32;
this.keyFrame11.Opacity = 1F;
this.keyFrame11.Position = new System.Drawing.Point(615, 181);
this.keyFrame11.Rotation = 0F;
this.keyFrame11.Visible = true;
this.keyFrame11.XScale = 5;
this.keyFrame11.YScale = 2;
this.keyFrame11.ZOrder = 4;
//
// keyFrame12
//
this.keyFrame12.Duration = 32;
this.keyFrame12.Opacity = 1F;
this.keyFrame12.Position = new System.Drawing.Point(51, 32);
this.keyFrame12.Rotation = 0F;
this.keyFrame12.Visible = true;
this.keyFrame12.XScale = 1;
this.keyFrame12.YScale = 1;
this.keyFrame12.ZOrder = 4;
//
// keyFrame13
//
this.keyFrame13.Duration = 32;
this.keyFrame13.Opacity = 1F;
this.keyFrame13.Position = new System.Drawing.Point(31, 224);
this.keyFrame13.Rotation = 0F;
this.keyFrame13.Visible = true;
this.keyFrame13.XScale = 1;
this.keyFrame13.YScale = 1;
this.keyFrame13.ZOrder = 4;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(688, 534);
this.Controls.Add(this.spritePanel1);
this.Name = "Form1";
this.Text = "Sprites";
this.spritePanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}