Changeset 2867 for libcaca/trunk/csharp/test.cs
- Timestamp:
- Oct 5, 2008, 2:56:17 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/csharp/test.cs
r2822 r2867 21 21 using Caca; 22 22 23 class DemoCanvas : Ca caCanvas23 class DemoCanvas : Canvas 24 24 { 25 25 private uint[,] image; 26 26 27 27 private DateTime startTime; 28 private CacaDither d;29 private Ca caCanvas scroll;28 private Dither d; 29 private Canvas scroll; 30 30 31 31 public DemoCanvas() … … 35 35 string message = " --- POWERED BY LIBCACA --- OLDSCHOOL TEXT EFFECTS ARE 100% PURE WIN"; 36 36 37 scroll = new Ca caCanvas(new Size(message.Length, 1));38 scroll.setColorAnsi( Libcaca.WHITE, Libcaca.TRANSPARENT);37 scroll = new Canvas(new Size(message.Length, 1)); 38 scroll.setColorAnsi(AnsiColor.WHITE, AnsiColor.TRANSPARENT); 39 39 scroll.putStr(new Point(0, 0), message); 40 40 41 Caca Font f = new CacaFont(CacaFont.getList()[1]);41 Caca.Font f = new Caca.Font(Caca.Font.getList()[1]); 42 42 int w = f.Size.Width * message.Length; 43 43 int h = f.Size.Height; 44 44 image = new uint[w, h]; 45 d = new CacaDither(32, new Size(w, h), w * 4,45 d = new Dither(32, new Size(w, h), w * 4, 46 46 0xff00, 0xff0000, 0xff000000, 0xff); 47 47 f.Render(scroll, image, image.GetLength(0) * 4); … … 55 55 Clear(); 56 56 57 setColorAnsi( Libcaca.WHITE, Libcaca.BLACK);57 setColorAnsi(AnsiColor.WHITE, AnsiColor.BLACK); 58 58 for(int i = 0; i < barCount; i++) 59 59 { … … 63 63 Point p2 = new Point(Size.Width - 1, (int)v); 64 64 65 setColorAnsi((uint)(i + 9), Libcaca.BLACK);65 setColorAnsi((uint)(i + 9), AnsiColor.BLACK); 66 66 /* drawLine is already clipped, we don't care about overflows */ 67 67 drawLine(p1 + new Size(0, -2), p2 + new Size(0, -2), '-'); … … 79 79 ditherBitmap(new Rectangle(12 * w - x, h / 2 - y, w * 12, y * 2), d, image); 80 80 81 setColorAnsi( Libcaca.WHITE, Libcaca.BLUE);81 setColorAnsi(AnsiColor.WHITE, AnsiColor.BLUE); 82 82 putStr(new Point(-30, -2) + Size, " -=[ Powered by libcaca ]=- "); 83 setColorAnsi( Libcaca.WHITE, Libcaca.BLACK);83 setColorAnsi(AnsiColor.WHITE, AnsiColor.BLACK); 84 84 } 85 85 } 86 86 87 class DemoDisplay : CacaDisplay87 class DemoDisplay : Display 88 88 { 89 89 private DemoCanvas cv; … … 98 98 public void EventLoop() 99 99 { 100 CacaEvent ev;100 Event ev; 101 101 102 while((ev = getEvent( CacaEventType.KEY_RELEASE, 10)).Type == 0)102 while((ev = getEvent(EventType.KEY_RELEASE, 10)).Type == 0) 103 103 { 104 104 cv.Draw();
Note: See TracChangeset
for help on using the changeset viewer.