View Single Post
Old 13 December 2011, 22:20   #1
bruZard
 
Posts: n/a
Monkey Amiga Target 0.25

0.25 is live
Monkey Amiga Target v0.25



Quote:
12/13/2011 v0.25
added : class Image
added : Image.Width
added : Image.Height
added : Image.Depth
added : Image.Load:Void(filename:String, remapColors:Bool = False)
added : Image.Free:Void()
added : LoadImage:Image(filename:String)
added : LoadImage:Image(filename:String, remapColors:Byte)
added : Window.DrawImage:Void(img:Image, x:Int, y:Int)
added : DrawImage:Void(win:Window, img:Image, x:Int, y:Int)
added : DrawImage:Void(img:Image, x:Int, y:Int) [Mojo Style]
added : FreeImage:Void(img:Image)
added : Window.SetScreen:Void(pubScreen:String = "workbench")
added : SetScreen:Void(win:Window, pubScreen:String = "workbench")
added : SetScreen:Void(pubScreen:String = "workbench") [Mojo Style]
added : SetUpdateRate:Void(hertz:Int) [only with Mojo Style]
added : Window.getWidth:Int()
added : Window.getHeight:Int()
added : WindowWidth:Int(win:Window)
added : WindowHeight:Int(win:Window)
added : DeviceWidth:Int() [Mojo Style]
added : DeviceHeight:Int() [Mojo Style]
changed : MilliSecs() now returns a 64 bit value
changed : CreateWindow() now has the optional parameter "borderless"
fixed : ClsColor() now affects the BPen
fixed : in Mojo-Style now the workbench will be locked
Code:
Import amigaos3

Class myApp extends App
    Field mx:Int
    Field my:int
    Field time:Int
    Field FPS:Int
    Field tmpFPS:Int
    Field tmpTime:int
    Field lastFPS:Int
    Field fnt:Font
    Field lastX:Int
    Field lastY:Int
    Field img:Image
    Field bg:Image
    
    Method OnCreate()
        fnt = LoadFont("helvetica.font", 16)
        img = LoadImage("amiga.data/monkey.iff")
        bg = LoadImage("amiga.data/background.jpg")
        
        SetFont(fnt)
        AppTitle("draw with Monkey")
        
        SetColor(255, 255, 0)
        ClsColor(200, 90, 0)
        Cls()
                
        lastX = 0
        lastY = 0
        
        SetUpdateRate(60)
    End
    
    Method OnUpdate()
        mx = MouseX()
        my = MouseY()
        tmpFPS = tmpFPS + 1
        tmpTime = MilliSecs()
        
        if tmpTime - time > 1000
            FPS        = tmpFPS
            tmpFPS    = 0
            time     = tmpTime
        EndIf
    End
    
    Method OnRender()
        DrawImage(bg, 0, 0)
        
        if MouseDown() 
            DrawCircle(mx-1, my-1, 3)
            if lastX > 0 And lastY > 0 DrawLine(lastX, lastY, mx, my)
            lastX = mx
            lastY = my
        EndIf
        
        if tmpTime <> time DrawText("FPS: " + FPS, 10, 10)
        
        DrawImage(img, mx, my)
    End
End

Function Main()
    New myApp
End
this will not work on a real 68k Amiga (ok, it will work, but you need time and patience). Still use a AOS4/MOS machine or try it on aros or WinUAE.
 
AdSense AdSense  
 
Page generated in 0.04892 seconds with 9 queries