Giter Club home page Giter Club logo

minimalcomps-openfl's Introduction

Minimal Components

OpenFL port of Minimal Components by Keith Peters.

API Documentation

MinimalComps OpenFL Designer is a compendium project enabling exploration of available components.

screen-capture

Web demo: https://jasonsturges.github.io/minimalcomps-openfl-designer/

Installation

This library can be installed through any of the following ways.

To use the latest release from haxelib:

$ haxelib install minimalcomps

To use the latest development from GitHub:

$ haxelib git minimalcomps https://github.com/jasonsturges/minimalcomps-openfl.git

To use a local copy as a development haxelib, clone this repo and link the source directory by executing:

$ git clone https://github.com/jasonsturges/minimalcomps-openfl.git
$ haxelib dev minimalcomps ./minimalcomps-openfl

Project Setup

For inclusion into a Haxe project, add this library by updating your project.xml:

<project>
    ...
    <haxelib name="minimalcomps" />
    ...
</project>

Themes, fonts, and color styles

Two color themes are included, which setup both colors and the default pf_ronda_seven.ttf font for your project; however, additional configuration of colors and fonts are possible.

Themes

There are two themes included: Light and Dark.

When using these themes, call Style.setStyle() before creating any components:

import minimalcomps.components.Style;

Style.setStyle(Style.DARK);
Style.setStyle(Style.LIGHT);

Colors

For additional configuration of custom styles, update properties of the Style class.

import minimalcomps.components.Style;

Style.BACKGROUND = 0xCCCCCC;
Style.BUTTON_FACE = 0xFFFFFF;
Style.BUTTON_DOWN = 0xEEEEEE;
Style.INPUT_TEXT = 0x333333;
Style.LABEL_TEXT = 0x666666;
Style.PANEL = 0xF3F3F3;
Style.PROGRESS_BAR = 0xFFFFFF;
Style.TEXT_BACKGROUND = 0xFFFFFF;
Style.LIST_DEFAULT = 0xFFFFFF;
Style.LIST_ALTERNATE = 0xF3F3F3;
Style.LIST_SELECTED = 0xCCCCCC;
Style.LIST_ROLLOVER = 0xDDDDDD;

Fonts

To use a custom font in your project, place the font within your project's Assets/Fonts folder:

[project root]/Assets/Fonts/my-font.ttf

Update your project.xml to include the font definition:

<project>
    ...
    <assets path="Assets/Fonts" rename="fonts" if="html5">
        <font path="my-font.ttf" id="my-font" />
    </assets>
    ...
</project>

In your project's source code, embed the font using the following class definition:

import openfl.text.Font;

@:font("Assets/Fonts/my-font.ttf") private class MyFont extends Font {}

Finally, add the following code to register the font and set the Style class fontName:

import openfl.Assets;
import openfl.text.Font;
import minimalcomps.components.Style;

#if js
    Style.fontName = Assets.getFont("my-font").fontName;
#else
    Font.registerFont(MyFont);
    Style.fontName = (new MyFont()).fontName;
#end

Generating Dox Documentation

To generate documentation using dox, execute:

haxe documentation.hxml

License

This project is free, open-source software under the MIT license.

Copyright (c) 2017 Jason Sturges

Copyright (c) 2011 Keith Peters

minimalcomps-openfl's People

Contributors

jasonsturges avatar joshtynjala avatar

Stargazers

 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

minimalcomps-openfl's Issues

TextArea/Text is stopping (cpp windows)

When I wanted to add TextArea or Text to the stage (while target cpp windows), the app is stop working.
When I check the Event Viewer I see this:

Exception code: 0xc0000409
Fault offset: 0x00c81677
Faulting process id: 0x10c8
Faulting application start time: 0x01d39a67dd0f983d
Report Id: a08d5015-75b6-4487-bbad-0f96b3e9b9ab

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.