Giter Club home page Giter Club logo

advanced-layout's People

Contributors

gama11 avatar player-03 avatar t1ml3arn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advanced-layout's Issues

Misleading introduction

The readme starts like this:

An easy way to create fluid layouts in Flash and OpenFL.

But then later goes on to mention that other things like HaxeUI are supported too, so perhaps the phrasing could be improved a bit?

layout.LayoutPreserver having problems in scaling !

Hi,

i am using .preserveChildren(); to preserve the Movieclip which i am loading from the library
but unfortunately i am not getting the exact size it looks like it is scaling twice the size of the container.

I am using it like this:

view = new LanguageScreenBase();
addChild(view);
view.preserveChildren();

Result:

The green line is the border of the container coming from Flash

image

or i am missing something !
thanks and happy new year

What do I give to screenDPI to get consistently-sized text?

(If this is the wrong place to post this, I'm happy to go where I'm supposed to)

I have the following:

Source/Main.hx:

package;

import openfl.display.Sprite;
import openfl.Assets;
import openfl.text.TextField;
import openfl.text.TextFormat;
import openfl.system.System;
import openfl.system.Capabilities;
import layout.Layout;

using layout.LayoutCreator;


class Main extends Sprite {
    // private var _conn:Connection = null;
    
    public function new() {
        super();

        // Scale
        trace('stage.window.scale ${stage.window.scale}');
        trace('Capabilities.screenDPI ${Capabilities.screenDPI}');
        Layout.stageLayout.scale.screenDPI(Std.int(Capabilities.screenDPI));

        // Load fonts
        var bold14Font = new TextFormat("assets/fonts/Lato-Bold", 14, 0xffffff);

        // Components
        var navbarBackground = new Sprite();
        addChild(navbarBackground);

        navbarBackground.graphics.beginFill(0x2c3e50);
        navbarBackground.graphics.drawRect(0, 0, 10, 10);

        var text1 = new TextField();
        text1.defaultTextFormat = bold14Font;
        text1.text = 'Hello';
        addChild(text1);

        // Scale components
        navbarBackground.simpleScale();
        navbarBackground.fillHeight();
        navbarBackground.alignTopLeft();
        navbarBackground.exactWidth(100);
    }
}

project.xml:

<?xml version="1.0" encoding="utf-8"?>
<project>
    <meta title="Test" package="com.example.test" version="0.1.0" company="Test" />
    <app main="Main" path="Export" file="Test" />
    <source path="Source" />
    <haxelib name="openfl" />
    <haxelib name="advanced-layout" />
    <assets path="Assets" rename="assets" />

    <window allow-high-dpi="true" />
</project>

Which renders the textfield and blue bar too small:

screen shot 2018-08-14 at 4 15 25 pm


If I remove <window allow-high-dpi="true" /> from project.xml it looks like this:

screen shot 2018-08-14 at 4 14 54 pm

This is the size "in inches" that I want for the blue bar and text, but with blurry text.


To make the text sharp, I can add <window allow-high-dpi="true" /> back in and then add this code.

        text1.scaleX = 2;
        text1.scaleY = 2;

screen shot 2018-08-14 at 4 13 11 pm

but that doesn't scale the blue bar the same as the text.


Changing Layout.stageLayout.scale.screenDPI(...) doesn't do anything as far as I can tell.

Is there a way to make the blue bar an "inch" wide on all screens and the text smooth using Advanced Layout?

problem with last openfl?

I get this error with last openfl

/usr/lib/haxe/lib/advanced-layout/git/layout/item/TextSize.hx:42: characters 2-38 : Float should be Null<Int>
/usr/lib/haxe/lib/advanced-layout/git/layout/item/TextSize.hx:42: characters 2-38 : Float should be Int

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.