- twiggery_ver_0_5_2.zip
- Examples
- eg_01 [hello world].twg
- eg_02 [if-elseif-else].twg
- eg_03 [for-to-step].twg
- eg_04 [while, do-while].twg
- eg_05 [search prime].twg
- eg_06 [calculate PI].twg
- eg_07 [using plugins].twg
- eg_08 [IO plugin test].twg
- eg_09 [Graphics plugin test].twg
- eg_10 [pong].twg
- eg_11 [calculator].twg
- eg_12 [image].twg
- media
- ding.wav
- sprite.bmp
- Histroy.txt
- IDE
- CodeLeaf.exe
- Plugins
- Twiggery.dll
- License.txt
- Programming_with_Twiggery.pdf
- Source
- CodeLeaf
- Plugin
- Audio
- Core
- Graphics
- IO
- Math
- Test
- Twiggery.sln
- Twiggery.suo
- Twiggery
- TDK
- ShellCpp
- release
- ts.exe
- TVM_Win32.dll
- TVM_Win32.exp
- TVM_Win32.lib
- TVM_Win32.sln
- TVM_Win32.suo
- TVM_Win32
- TVM_Win32_Test
- ShellDotNet
- ShellJava
- build.xml
- dist
- js.jar
- manifest.mf
- nbproject
- src
- javaapplication
- Twiggery
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
using System.Drawing;
using num = System.Single;
using arguments = System.Collections.Generic.List<object>;
namespace Twiggery.Plugin.Graphics
{
internal abstract class Sprite
{
protected int x;
protected int y;
protected Pen p;
protected Color c;
protected bool visable = true;
public abstract void Render(System.Drawing.Graphics g);
public abstract void SetSize(arguments args);
public virtual void GetVisible(arguments args)
{
args.Add(visable ? (num)1 : (num)0);
}
public virtual void SetVisible(arguments args)
{
int vs = (int)(num)args[0];
visable = vs == 1;
}
public virtual void Remove()
{
// Do nothing
}
public virtual void SetAttribute(arguments args)
{
// Do nothing
}
public virtual void SetPosition(int _x, int _y)
{
x = _x;
y = _y;
}
public virtual void SetColor(Color _c)
{
c = _c;
p = new Pen(c);
}
public virtual void SetColor(int _ch, int _v)
{
Color _c = Color.Black;
switch (_ch)
{
case 1://"R":
_c = Color.FromArgb(_v, c.G, c.B);
break;
case 2://"G":
_c = Color.FromArgb(c.R, _v, c.B);
break;
case 3://"B":
_c = Color.FromArgb(c.R, c.G, _v);
break;
}
c = _c;
p = new Pen(c);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.