8000 GitHub - aiv01/aiv-draw at 0.7.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aiv01/aiv-draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aiv-draw

Simple wrapper for teaching computer graphics principles to AIV first year students

using System;
using Aiv.Draw;

namespace DrawTest
{
  class MainClass
  {
    public static void Main (string[] args)
    {
       Window window = new Window (1024, 768, "Hello", PixelFormat.RGB);
       while (window.opened) {
        // write bytes into window.bitmap array to draw ...
        // read window.deltaTime to get float time delta (1f = 1 second)
        // call window.GetKey(KeyCode.xxx) to check for key press
        window.Blit ();
       }
    }
  }
}

You can get an RGBA array from images using the Sprite class:

Sprite hero = new Sprite("heroSpriteSheet.png");
byte []bitmap = hero.bitmap;
int width = hero.width;
int height = hero.height;

You can update Window title like this:

window.SetTitle("Your new title");

About

Simple wrapper for teaching computer graphics principles to AIV first year students

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages

0