home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Grafica / Animation / AnimationStudioSetup.msi / _3CA7015D32004C8B8FAB422593C47FB8 / _A1F34E7425EA474044D544CBF0B7A334 < prev    next >
Text File  |  2004-05-14  |  8KB  |  251 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7.  
  8. namespace Tutorial_1
  9. {
  10.     /// <summary>
  11.     /// Summary description for Form1.
  12.     /// </summary>
  13.     public class Form1 : System.Windows.Forms.Form
  14.     {
  15.         private AnimationStudio.SpritePanel spritePanel1;
  16.         private AnimationStudio.Sprite sprite1;
  17.         private AnimationStudio.KeyFrame keyFrame1;
  18.         private AnimationStudio.KeyFrame keyFrame2;
  19.         private AnimationStudio.KeyFrame keyFrame3;
  20.         private AnimationStudio.KeyFrame keyFrame4;
  21.         private AnimationStudio.KeyFrame keyFrame5;
  22.         private AnimationStudio.KeyFrame keyFrame6;
  23.         private AnimationStudio.KeyFrame keyFrame7;
  24.         private System.Windows.Forms.RichTextBox richTextBox1;
  25.         /// <summary>
  26.         /// Required designer variable.
  27.         /// </summary>
  28.         private System.ComponentModel.Container components = null;
  29.  
  30.         public Form1()
  31.         {
  32.             //
  33.             // Required for Windows Form Designer support
  34.             //
  35.             InitializeComponent();
  36.             //
  37.             // TODO: Add any constructor code after InitializeComponent call
  38.             //
  39.         }
  40.  
  41.         /// <summary>
  42.         /// Clean up any resources being used.
  43.         /// </summary>
  44.         protected override void Dispose( bool disposing )
  45.         {
  46.             if( disposing )
  47.             {
  48.                 if (components != null) 
  49.                 {
  50.                     components.Dispose();
  51.                 }
  52.             }
  53.             base.Dispose( disposing );
  54.         }
  55.  
  56.         #region Windows Form Designer generated code
  57.         /// <summary>
  58.         /// Required method for Designer support - do not modify
  59.         /// the contents of this method with the code editor.
  60.         /// </summary>
  61.         private void InitializeComponent()
  62.         {
  63.             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
  64.             AnimationStudio.Sound sound1 = new AnimationStudio.Sound();
  65.             this.spritePanel1 = new AnimationStudio.SpritePanel();
  66.             this.richTextBox1 = new System.Windows.Forms.RichTextBox();
  67.             this.sprite1 = new AnimationStudio.Sprite(this.spritePanel1);
  68.             this.keyFrame1 = new AnimationStudio.KeyFrame();
  69.             this.keyFrame2 = new AnimationStudio.KeyFrame();
  70.             this.keyFrame3 = new AnimationStudio.KeyFrame();
  71.             this.keyFrame4 = new AnimationStudio.KeyFrame();
  72.             this.keyFrame5 = new AnimationStudio.KeyFrame();
  73.             this.keyFrame6 = new AnimationStudio.KeyFrame();
  74.             this.keyFrame7 = new AnimationStudio.KeyFrame();
  75.             this.spritePanel1.SuspendLayout();
  76.             this.SuspendLayout();
  77.             // 
  78.             // spritePanel1
  79.             // 
  80.             this.spritePanel1.BackColor = System.Drawing.Color.DarkGray;
  81.             this.spritePanel1.Controls.Add(this.richTextBox1);
  82.             this.spritePanel1.Location = new System.Drawing.Point(8, 8);
  83.             this.spritePanel1.Name = "spritePanel1";
  84.             this.spritePanel1.Size = new System.Drawing.Size(664, 424);
  85.             this.spritePanel1.Sprites.AddRange(new AnimationStudio.Sprite[] {
  86.                                                                                 this.sprite1});
  87.             this.spritePanel1.TabIndex = 0;
  88.             // 
  89.             // richTextBox1
  90.             // 
  91.             this.richTextBox1.BackColor = System.Drawing.Color.LightSkyBlue;
  92.             this.richTextBox1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  93.             this.richTextBox1.ForeColor = System.Drawing.Color.Black;
  94.             this.richTextBox1.Location = new System.Drawing.Point(232, 208);
  95.             this.richTextBox1.Name = "richTextBox1";
  96.             this.richTextBox1.ReadOnly = true;
  97.             this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
  98.             this.richTextBox1.ShowSelectionMargin = true;
  99.             this.richTextBox1.Size = new System.Drawing.Size(424, 208);
  100.             this.richTextBox1.TabIndex = 2;
  101.             this.richTextBox1.Text = @"Try the following things:
  102.  
  103. 1) Right click in the SpritePanel and activate the context menu
  104. 2) Select: Stop all Sprites
  105. 3) Select the Sprite and open its context menu
  106. 4) Select: Show Path
  107. 5) Select: Start Sprite (context menu of the Sprite)
  108. 6) Drag the KeyFrames (red spots)
  109. 7) Click a KeyFrame and change its properties in the property page
  110. 8) Try changing other KeyFrames and the PathForm Sprite property
  111. 9) Add a KeyFrame (context menu of the Sprite, or in the property tab)
  112.  
  113. Watch the result of all changes in realtime in the  designer
  114. Compile and run the example
  115. Open Tutorial 2";
  116.             // 
  117.             // sprite1
  118.             // 
  119.             this.sprite1.BorderColor = System.Drawing.Color.WhiteSmoke;
  120.             this.sprite1.BorderWidth = 2F;
  121.             this.sprite1.DrawBorder = false;
  122.             this.sprite1.DrawPath = false;
  123.             this.sprite1.DrawText = false;
  124.             this.sprite1.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold);
  125.             this.sprite1.Image = ((System.Drawing.Bitmap)(resources.GetObject("sprite1.Image")));
  126.             this.sprite1.PathClosed = true;
  127.             this.sprite1.Position = new System.Drawing.Point(525, 264);
  128.             this.sprite1.Size = new System.Drawing.Size(51, 51);
  129.             sound1.SoundFile = "";
  130.             this.sprite1.Sound = sound1;
  131.             this.sprite1.Text = "Sprite";
  132.             this.sprite1.TextColor = System.Drawing.Color.DarkRed;
  133.             this.sprite1.Timeline.AddRange(new AnimationStudio.KeyFrame[] {
  134.                                                                               this.keyFrame1,
  135.                                                                               this.keyFrame2,
  136.                                                                               this.keyFrame3,
  137.                                                                               this.keyFrame4,
  138.                                                                               this.keyFrame5,
  139.                                                                               this.keyFrame6,
  140.                                                                               this.keyFrame7});
  141.             this.sprite1.TransparentColor = System.Drawing.Color.Black;
  142.             this.sprite1.XScale = 1F;
  143.             this.sprite1.YScale = 1F;
  144.             // 
  145.             // keyFrame1
  146.             // 
  147.             this.keyFrame1.Duration = 32;
  148.             this.keyFrame1.Opacity = 1F;
  149.             this.keyFrame1.Position = new System.Drawing.Point(229, 19);
  150.             this.keyFrame1.Rotation = 0F;
  151.             this.keyFrame1.Visible = true;
  152.             this.keyFrame1.XScale = 1;
  153.             this.keyFrame1.YScale = 1;
  154.             this.keyFrame1.ZOrder = 0;
  155.             // 
  156.             // keyFrame2
  157.             // 
  158.             this.keyFrame2.Duration = 32;
  159.             this.keyFrame2.Opacity = 1F;
  160.             this.keyFrame2.Position = new System.Drawing.Point(22, 31);
  161.             this.keyFrame2.Rotation = 0F;
  162.             this.keyFrame2.Visible = true;
  163.             this.keyFrame2.XScale = 1;
  164.             this.keyFrame2.YScale = 1;
  165.             this.keyFrame2.ZOrder = 0;
  166.             // 
  167.             // keyFrame3
  168.             // 
  169.             this.keyFrame3.Duration = 32;
  170.             this.keyFrame3.Opacity = 1F;
  171.             this.keyFrame3.Position = new System.Drawing.Point(55, 371);
  172.             this.keyFrame3.Rotation = 0F;
  173.             this.keyFrame3.Visible = true;
  174.             this.keyFrame3.XScale = 1;
  175.             this.keyFrame3.YScale = 1;
  176.             this.keyFrame3.ZOrder = 0;
  177.             // 
  178.             // keyFrame4
  179.             // 
  180.             this.keyFrame4.Duration = 32;
  181.             this.keyFrame4.Opacity = 1F;
  182.             this.keyFrame4.Position = new System.Drawing.Point(231, 101);
  183.             this.keyFrame4.Rotation = 0F;
  184.             this.keyFrame4.Visible = true;
  185.             this.keyFrame4.XScale = 1;
  186.             this.keyFrame4.YScale = 1;
  187.             this.keyFrame4.ZOrder = 0;
  188.             // 
  189.             // keyFrame5
  190.             // 
  191.             this.keyFrame5.Duration = 32;
  192.             this.keyFrame5.Opacity = 1F;
  193.             this.keyFrame5.Position = new System.Drawing.Point(645, 21);
  194.             this.keyFrame5.Rotation = 0F;
  195.             this.keyFrame5.Visible = true;
  196.             this.keyFrame5.XScale = 1;
  197.             this.keyFrame5.YScale = 1;
  198.             this.keyFrame5.ZOrder = 0;
  199.             // 
  200.             // keyFrame6
  201.             // 
  202.             this.keyFrame6.Duration = 32;
  203.             this.keyFrame6.Opacity = 1F;
  204.             this.keyFrame6.Position = new System.Drawing.Point(520, 345);
  205.             this.keyFrame6.Rotation = 0F;
  206.             this.keyFrame6.Visible = true;
  207.             this.keyFrame6.XScale = 1;
  208.             this.keyFrame6.YScale = 1;
  209.             this.keyFrame6.ZOrder = 0;
  210.             // 
  211.             // keyFrame7
  212.             // 
  213.             this.keyFrame7.Duration = 32;
  214.             this.keyFrame7.Opacity = 1F;
  215.             this.keyFrame7.Position = new System.Drawing.Point(454, 20);
  216.             this.keyFrame7.Rotation = 0F;
  217.             this.keyFrame7.Visible = true;
  218.             this.keyFrame7.XScale = 1;
  219.             this.keyFrame7.YScale = 1;
  220.             this.keyFrame7.ZOrder = 0;
  221.             // 
  222.             // Form1
  223.             // 
  224.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  225.             this.ClientSize = new System.Drawing.Size(680, 446);
  226.             this.Controls.Add(this.spritePanel1);
  227.             this.Name = "Form1";
  228.             this.Text = "Tutorial 1 - Basics";
  229.             this.Load += new System.EventHandler(this.Form1_Load);
  230.             this.spritePanel1.ResumeLayout(false);
  231.             this.ResumeLayout(false);
  232.  
  233.         }
  234.         #endregion
  235.  
  236.         /// <summary>
  237.         /// The main entry point for the application.
  238.         /// </summary>
  239.         [STAThread]
  240.         static void Main() 
  241.         {
  242.             Application.Run(new Form1());
  243.         }
  244.  
  245.         private void Form1_Load(object sender, System.EventArgs e)
  246.         {
  247.         
  248.         }
  249.     }
  250. }
  251.