• A
    anssshu

    @robert
    In Mac gamepad is working for Godot engine ,but why not for kha.Please tell me about how to recompile kha kore or krom so that gamepad will work

    posted in Kode read more
  • A
    anssshu

    @robert
    I wrote a complete sprite class which takes an image asset and convert into
    a sprite which can be positioned ,rotated ,scale and its anchor position can be changed

    posted in Kode read more
  • A
    anssshu

    @greger-olsson
    Thank u Greger ,
    I am also new to Kha,I tried it in Linux also but still having the same problem.let me check those codes you mentioned ,if I have some luck.

    posted in Kode read more
  • A
    anssshu

    //Sprite.hx

    //import libraries

    import kha.graphics2.Graphics;
    import kha.math.FastMatrix3;
    import kha.Image;

    class Sprite{
    public var img:Image;
    public var ax = 0.5; //anchor x
    public var ay = 0.5; //anchor y
    public var r = 0.0; //rotation in rad
    public var x = 0.0; //x pos
    public var y = 0.0; //y pos
    public var w = 100.0; //width
    public var h = 100.0; //height
    public var sx = 1.0; //scale
    public var sy = 1.0 ; //scale

    public function new(image:Image){
    	this.img = image;
    	this.w = this.img.width;
    	this.h = this.img.height;
    }
    
    public function update(){
    	//this.r+=1.0;
    
    }
    
    public function render(graphics:Graphics){
    
    	graphics.pushTransformation(FastMatrix3.translation(this.x,this.y));
    	graphics.rotate(this.degTorad(this.r),this.x,this.y);
    	//graphics.fillRect(-this.ax*this.w,-this.ay*this.h,this.w,this.h);
    	graphics.drawScaledImage(this.img,-this.ax*this.w,-this.ay*this.h,this.w*this.sx,this.h*this.sy);
    	graphics.popTransformation();
    }
    
    private function degTorad(deg:Float){
    	return deg*(Math.PI/180.0);
    }
    

    }

    posted in Kode read more
  • A
    anssshu

    Hi I was working on a kha game project in Kode Studio and added gamepad support to it .After coding everything is working fine ,the gamepads are working properly in debug mode .But when I compiled the code to native Mac app, or Linux app the application is not taking input from
    the game pad.

    If some body has come across such issues before then please help

    posted in Kode read more

Looks like your connection to Kode Forum was lost, please wait while we try to reconnect.