https://linen.dev logo
Join Discord
Powered by
# openfl
  • h

    hallowed-ocean-84954

    07/25/2022, 11:34 PM
    Of course the right way to do it is to make it a generic lime.ui. window feature, but crawl first then walk I guess
  • a

    able-printer-41379

    07/25/2022, 11:35 PM
    rooks can you mention me when you figure it out please
  • a

    able-printer-41379

    07/25/2022, 11:35 PM
    im going to sleep now since im very tired
  • m

    many-addition-78652

    07/25/2022, 11:35 PM
    Yeah first get it to work and then make it nice 🙂
  • h

    hallowed-ocean-84954

    07/25/2022, 11:36 PM
    I won't be working on this much for at least a week or so at the earliest
  • l

    late-australia-6304

    07/29/2022, 4:30 AM
    how do i get the actual amount of ram the task is using (System.totalMemory does not give the task ram)
  • p

    powerful-morning-89

    07/29/2022, 12:44 PM
    Iirc
    System.totalMemory
    gives the amount of memory that is allocated via Hxcpp's GC. That's not the total memory used by the process, SDL and Windows will allocate things behind the scene. So to get the total memory you'll have to use platform-specific api's.
  • p

    powerful-morning-89

    07/29/2022, 12:47 PM
    Eg
  • e

    enough-lawyer-1858

    07/29/2022, 10:52 PM
    what glsl version does openfl use?
  • e

    enough-lawyer-1858

    07/29/2022, 10:53 PM
    It's because depending on what I want to do, some things aren't available and I need to know tbh
  • m

    many-addition-78652

    07/29/2022, 11:13 PM
    I think the rendering is based on opengl es 2.0 so that would be glsl es which is similar but not exactly the same as normal glsl. It is based on glsl 1.10. I'm not 100% sure though.
  • h

    hallowed-ocean-84954

    07/29/2022, 11:15 PM
    The problem is the version isn't specified so it defaults to whatever. And yes I believe it's 110. Openfl needs a version PR
  • f

    future-iron-61487

    08/01/2022, 6:27 AM
    Is it possible to make OpenFL target anything other than GLES?
  • f

    future-iron-61487

    08/01/2022, 6:28 AM
    (basically wondering how DirectX is handled)
  • l

    lemon-candle-43865

    08/01/2022, 6:40 AM
    I don't know if it still works, but years ago, support was added for winrt/uwp, and that used angle to translate opengl to directx.
  • p

    powerful-morning-89

    08/01/2022, 8:17 AM
    If you rewrite half of OpenFL and Lime, sure. If you're lucky the 2d stuff runs on top of Stage3D and you only have to make that use DX or Metal or whatever. But iirc that's not the case. Alternatively use Angle, which involves less rewriting.
  • r

    refined-cat-44047

    08/01/2022, 9:51 PM
    Does OpenFL cache assets between compiles? I have a txt file asset that I make changes to, but it does not always update when I build. When I access it, it has the old text
  • r

    rhythmic-policeman-45046

    08/02/2022, 6:21 AM
    Hello, does anyone knows how to change the variables of a glsl shader inside the camera filter? Thanks!
  • c

    curved-tiger-81069

    08/04/2022, 11:31 PM
    heya so uh, is there any way of making a sprite scale with the window? (so it stretches over the screen instead of just infinitely extending when the window gets resized)
  • c

    curved-tiger-81069

    08/04/2022, 11:35 PM
    because from what i see when a window is resized it doesnt scale everything within the window and just reveals more of the sprite on screen
  • c

    curved-tiger-81069

    08/05/2022, 12:03 AM
    nvm i figured out how to fix it
  • t

    thousands-state-46635

    08/07/2022, 9:22 AM
    im making a drawing program, so far this is what i get when holding the mouse down, it draws it but... not really any lines
  • t

    thousands-state-46635

    08/07/2022, 9:22 AM
    this is the code:
    Copy code
    hx
    package;
    
    import openfl.events.Event;
    import openfl.events.MouseEvent;
    import openfl.display.BitmapData;
    import openfl.display.Bitmap;
    import openfl.display.Sprite;
    
    class Main extends Sprite
    {
    
        var canvasWidth:Int = 400;
        var canvasHeight:Int = 400;
        var canvasColor:Int = 0xFFFFFFFF;
        var canvas:Bitmap;
        var brushColor:Int = 0xFF000000;
    
        public function new()
        {
            super();
            initCanvas();
            addEventListeners();
        }
        
    
        private function onUpdate(ev:Event) {
        }
    
        private function mouseHandler(ev:MouseEvent) {
            if (ev.buttonDown) {
                canvas.bitmapData.unlock();
                canvas.bitmapData.setPixel32(Std.int(mouseX), Std.int(mouseY), brushColor);
                canvas.bitmapData.lock();
            }
        }
        private function initCanvas() {
            canvas = new Bitmap(new BitmapData(canvasWidth, canvasHeight, false, canvasColor));
            addChild(canvas);
        }
    
        private function addEventListeners() {
            addEventListener(Event.ENTER_FRAME, onUpdate);
            addEventListener(MouseEvent.MOUSE_MOVE, mouseHandler);
            
        }
    }
  • t

    thousands-state-46635

    08/07/2022, 9:22 AM
    any help?
  • b

    bulky-exabyte-6537

    08/07/2022, 9:27 AM
    mouse moves too fast for the frame rate
  • b

    bulky-exabyte-6537

    08/07/2022, 9:28 AM
    track the previous mouse position and current mouse position and draw a line between them using bitmap.graphics
  • b

    bright-gpu-74537

    08/07/2022, 9:29 AM
    theres a very simple paint example here: http://haxeui.org/explorer/ (last item on the left hand tree: "Simple Paint")... it basically does as nothingispossible is saying - might help you a little 🙂
  • b

    bright-gpu-74537

    08/07/2022, 9:30 AM
    but in essence it boils down to:
    Copy code
    haxe
        private var _downPos:Point = null;
        @:bind(canvas, MouseEvent.MOUSE_DOWN)
        private function onCanvasMouseDown(event:MouseEvent) {
            _downPos = new Point(event.localX, event.localY);
            canvas.componentGraphics.moveTo(_downPos.x, _downPos.y);
        }
    
        @:bind(canvas, MouseEvent.MOUSE_MOVE)
        private function onCanvasMouseMove(event:MouseEvent) {
            if (_downPos == null) {
                return;
            }
            canvas.componentGraphics.lineTo(event.localX, event.localY);
            _downPos = new Point(event.localX, event.localY);
        }
        
        @:bind(canvas, MouseEvent.MOUSE_UP)
        private function onCanvasMouseUp(event:MouseEvent) {
            _downPos = null;
        }
  • t

    thousands-state-46635

    08/07/2022, 9:41 AM
    ah thanks
  • t

    thousands-state-46635

    08/07/2022, 9:53 AM
    for some reason i can only draw on the outskirst...
12345...57Latest