Git Product home page Git Product logo

tripleagent's Introduction

TripleAgent

TripleAgent is an open source help agent control, with the purpose to display and animate a sprite with an associated label on a Windows Form. The control can be used to present important information in a fun way. Inspiration has been taken from the old Microsoft Agents (Clippy, Merlin, Rover, etc.).

TripleAgent Demo

Getting Started

Any spritesheet can be used, but ensure that each sprite in the sheet is the same size.

You can choose to define each animation separately and add to the control, or load a XML definition of all available animations when you intialize the control.

Example of animation data

<animations>
    <animation name="Walk" loopcount="3">
        <startframe num="131" />
        <endframe num="139" />
    </animation>
    <animation name="Dance" loopcount="-1" loopdelay="0">
        <startframe num="183" />
        <endframe num="188" />
    </animation>
    <animation name="Shoot">
        <startframe x="320" y="64" />
        <endframe x="320" y="192" />
    </animation>
</animations>

Each animation is defined with a name as identifier and childnodes that define the start- and endframe of the animation. Note that you can choose to specify the exact frame number calculated from left to right, top to down, or by specifying the start coordinates of each frame. There are also options to loop the animation a specified number of times with the attribute loopcount (-1 is infinetely). Loopdelay specifies if the animation should pause for a moment on the last frame until the loop continues.

Example of control declaration

Size spriteSize = new Size(64, 64);
Point spriteLocation = new Point(0, 0);
int spriteStartFrame = 131;

var agent = new TripleAgentControl(spriteSheet, spriteSize, spriteStartFrame, spriteLocation, animationFrameData);
Controls.Add(agent);

Example of how to show an animated tooltip

agent.ShowTip(agent.SpriteAnimations[0], "Sample text");

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

tripleagent's People

Contributors

binaryprovider avatar kilobytelogic avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.