home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 July
/
CMCD0704.ISO
/
Software
/
Freeware
/
Grafica
/
Animation
/
AnimationStudioSetup.msi
/
_3CA7015D32004C8B8FAB422593C47FB8
/
_A1F34E7425EA474044D544CBF0B7A334
< prev
next >
Wrap
Text File
|
2004-05-14
|
8KB
|
251 lines
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Tutorial_1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AnimationStudio.SpritePanel spritePanel1;
private AnimationStudio.Sprite sprite1;
private AnimationStudio.KeyFrame keyFrame1;
private AnimationStudio.KeyFrame keyFrame2;
private AnimationStudio.KeyFrame keyFrame3;
private AnimationStudio.KeyFrame keyFrame4;
private AnimationStudio.KeyFrame keyFrame5;
private AnimationStudio.KeyFrame keyFrame6;
private AnimationStudio.KeyFrame keyFrame7;
private System.Windows.Forms.RichTextBox richTextBox1;
/// <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();
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.keyFrame5 = new AnimationStudio.KeyFrame();
this.keyFrame6 = new AnimationStudio.KeyFrame();
this.keyFrame7 = 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(664, 424);
this.spritePanel1.Sprites.AddRange(new AnimationStudio.Sprite[] {
this.sprite1});
this.spritePanel1.TabIndex = 0;
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.LightSkyBlue;
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(232, 208);
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(424, 208);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = @"Try the following things:
1) Right click in the SpritePanel and activate the context menu
2) Select: Stop all Sprites
3) Select the Sprite and open its context menu
4) Select: Show Path
5) Select: Start Sprite (context menu of the Sprite)
6) Drag the KeyFrames (red spots)
7) Click a KeyFrame and change its properties in the property page
8) Try changing other KeyFrames and the PathForm Sprite property
9) Add a KeyFrame (context menu of the Sprite, or in the property tab)
Watch the result of all changes in realtime in the designer
Compile and run the example
Open Tutorial 2";
//
// sprite1
//
this.sprite1.BorderColor = System.Drawing.Color.WhiteSmoke;
this.sprite1.BorderWidth = 2F;
this.sprite1.DrawBorder = false;
this.sprite1.DrawPath = false;
this.sprite1.DrawText = false;
this.sprite1.Font = new System.Drawing.Font("Arial", 24F, 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(525, 264);
this.sprite1.Size = new System.Drawing.Size(51, 51);
sound1.SoundFile = "";
this.sprite1.Sound = sound1;
this.sprite1.Text = "Sprite";
this.sprite1.TextColor = System.Drawing.Color.DarkRed;
this.sprite1.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
this.keyFrame1,
this.keyFrame2,
this.keyFrame3,
this.keyFrame4,
this.keyFrame5,
this.keyFrame6,
this.keyFrame7});
this.sprite1.TransparentColor = System.Drawing.Color.Black;
this.sprite1.XScale = 1F;
this.sprite1.YScale = 1F;
//
// keyFrame1
//
this.keyFrame1.Duration = 32;
this.keyFrame1.Opacity = 1F;
this.keyFrame1.Position = new System.Drawing.Point(229, 19);
this.keyFrame1.Rotation = 0F;
this.keyFrame1.Visible = true;
this.keyFrame1.XScale = 1;
this.keyFrame1.YScale = 1;
this.keyFrame1.ZOrder = 0;
//
// keyFrame2
//
this.keyFrame2.Duration = 32;
this.keyFrame2.Opacity = 1F;
this.keyFrame2.Position = new System.Drawing.Point(22, 31);
this.keyFrame2.Rotation = 0F;
this.keyFrame2.Visible = true;
this.keyFrame2.XScale = 1;
this.keyFrame2.YScale = 1;
this.keyFrame2.ZOrder = 0;
//
// keyFrame3
//
this.keyFrame3.Duration = 32;
this.keyFrame3.Opacity = 1F;
this.keyFrame3.Position = new System.Drawing.Point(55, 371);
this.keyFrame3.Rotation = 0F;
this.keyFrame3.Visible = true;
this.keyFrame3.XScale = 1;
this.keyFrame3.YScale = 1;
this.keyFrame3.ZOrder = 0;
//
// keyFrame4
//
this.keyFrame4.Duration = 32;
this.keyFrame4.Opacity = 1F;
this.keyFrame4.Position = new System.Drawing.Point(231, 101);
this.keyFrame4.Rotation = 0F;
this.keyFrame4.Visible = true;
this.keyFrame4.XScale = 1;
this.keyFrame4.YScale = 1;
this.keyFrame4.ZOrder = 0;
//
// keyFrame5
//
this.keyFrame5.Duration = 32;
this.keyFrame5.Opacity = 1F;
this.keyFrame5.Position = new System.Drawing.Point(645, 21);
this.keyFrame5.Rotation = 0F;
this.keyFrame5.Visible = true;
this.keyFrame5.XScale = 1;
this.keyFrame5.YScale = 1;
this.keyFrame5.ZOrder = 0;
//
// keyFrame6
//
this.keyFrame6.Duration = 32;
this.keyFrame6.Opacity = 1F;
this.keyFrame6.Position = new System.Drawing.Point(520, 345);
this.keyFrame6.Rotation = 0F;
this.keyFrame6.Visible = true;
this.keyFrame6.XScale = 1;
this.keyFrame6.YScale = 1;
this.keyFrame6.ZOrder = 0;
//
// keyFrame7
//
this.keyFrame7.Duration = 32;
this.keyFrame7.Opacity = 1F;
this.keyFrame7.Position = new System.Drawing.Point(454, 20);
this.keyFrame7.Rotation = 0F;
this.keyFrame7.Visible = true;
this.keyFrame7.XScale = 1;
this.keyFrame7.YScale = 1;
this.keyFrame7.ZOrder = 0;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(680, 446);
this.Controls.Add(this.spritePanel1);
this.Name = "Form1";
this.Text = "Tutorial 1 - Basics";
this.Load += new System.EventHandler(this.Form1_Load);
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());
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
}
}