GithubHelp home page GithubHelp logo

openfl / openfl-samples Goto Github PK

View Code? Open in Web Editor NEW
77.0 15.0 41.0 8.28 MB

Haxelib-based OpenFL sample projects

Home Page: http://www.openfl.org

License: MIT License

Haxe 100.00%
haxe openfl openfl-samples

openfl-samples's Introduction

MIT License Haxelib Version Build Status

OpenFL Samples

Haxelib-based samples are located here, check out https://github.com/openfl/openfl-samples-haxe for NPM-based samples.

A collection of sample projects illustrating different OpenFL features.

Installation

haxelib install openfl
haxelib run openfl setup

The openfl-samples library will be installed automatically. If you need to install it alone, you can use the following command:

haxelib install openfl-samples

Listing Samples

You can browse the project directory, but it is generally simpler to use the following command to list available OpenFL samples:

openfl create

Creating Samples

Once you find a sample you would like to create, you can generate a copy using the "create" command:

openfl create PiratePig

This creates a copy in the current directory, but you can also specify an output directory if you prefer:

openfl create DisplayingABitmap BitmapTest

Development Builds

Clone the openfl-samples repository:

git clone https://github.com/openfl/openfl-samples

Tell haxelib where your development copy of openfl-samples is installed:

haxelib dev openfl-samples openfl-samples

To return to release builds:

haxelib dev openfl-samples

openfl-samples's People

Contributors

beeblerox avatar gama11 avatar haysclark avatar james4k avatar jgranick avatar johanvdb avatar joshtynjala avatar larsiusprime avatar player-03 avatar xdl 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  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  avatar  avatar

Watchers

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

openfl-samples's Issues

Can't build flash version of HerokuShaders

There compile error is:

openfl build flash
Source/Main.hx:25: characters 9-49 : Class not found : GLUniformLocation

Please let me know if it's a configuration issue on my end.

Thanks,
Shane

SimpleOpenGLView: silent crash on neko

SimpleOpenGLView immediately crashes for me on startup: "SimpleOpenGLView.exe doesn't work anymore". There's no stacktrace. The Visual Studio Debugger claims the crash originates in neko.dll:

Seems to work fine on windows. Latest OpenFL / Lime versions from haxelib.

OpenGLView is not initialised on HerokuShaders for html5

With the supplied project.xml build file, the HerokuShaders example does not work on html5 - the call to OpenGLView.isSupported returns false.

I first assumed that I'd need the -D webgl flag, but that didn't work either - OpenGLView.isSupported will return true but the webgl context is not initialised (at runtime lime_graphics_opengl_GL.context is null). So I had to investigate the code in OpenGLView.

It seems to need the -D dom flag setting to work properly on html5. But it's not clear if -D webgl is also needed or of any benefit.

Adding <haxeflag name"-D dom" if="html5" /> to project.xml fixes the issue.

Class not found : UInt

When I try executing haxe build linux for "HandlingMouseEvents", I get the error:

/usr/share/haxe/lib/openfl/2,1,3/openfl/geom/Matrix3D.hx:174: lines 174-186 : Class not found : UInt

What is happening?

Custom fonts example doesn't work on HTML5

Custom fonts example doesn't work on HTML5. I am using Openfl compiler in IntelliJ, the Flash output looks ok but the HTML5 output is wired - it applies some default kind of sans font to letters but serif to numbers. Here is the project with my compiled outputs: https://dl.dropboxusercontent.com/u/2731147/CustomFont.zip

And here is a screenshot of the HTML5 vs Flash target: https://dl.dropboxusercontent.com/u/2731147/Screen%20Shot%202014-08-11%20at%2009.29.16.png

Heroku example fails to generate working hxml

If you try to run the hxml generated by "openfl display" you get:
/usr/lib/haxe/lib/openfl/1,0,5/openfl/display/DirectRenderer.hx:8: lines 8-13 : Class not found : DisplayObject

This was happening for all of the targets.

To recreate:

openfl create HerokuShaders
cd HerokuShaders
openfl update html5
openfl display html5 > test.hxml
haxe test.hxml

Running Samples

Can someone please add a 'Running Samples' section?
The required incantations are not obvious to me..
$ openfl create HelloTriangle
$ ls HelloTriangle/
HelloTriangle.hxproj project.xml Source
$ openfl run HelloTriangle
Error: You must have a "project.xml" file or specify another valid project file when using the 'run' command
Thanks.

Bug: SimpleOpenGLView

This happens when build the SimpleOpenGLView sample

Source/Main.hx:121: characters 25-45 : flash.geom.#Matrix3D has no field createOrtho (Suggestion: createOrth)

HTML5 BunnyMark blank screen

Hello!

Windows 10 64
Openfl 6.0.0
Haxe 3.4.2 (git build master @ 890f8c7)
Firefox 54.0.1/Chrome 59.0.3071.115
Debug/Release mode - same result

I got white screen with FPS-meter and no bunnies at start up or when clicked on stage.
CPP-version is working.

Adding trace() breaks flash version of PiratePig

I'm not sure what is the cause, but try to add trace('something') or Lib.trace('something') somewhere in PiratePig, and you will get WSOD, when targeting flash. Game will compile but won't start. This is important as this is a sample of the game, that will be inspiring many people, and they will discover this problem firstly in their own projects (like me). I'm not sure if this is problem with HaXe or something with architecture of this sample.

DrawingShapes: Could not find asset path "Assets"

A test with openfl create DrawingShapes on openfl-samples 3.3.1 seems to break with missing assets.

BP20140603JVDB:DrawingShapes johantheitguy$ haxelib list
actuate: [1.8.6]
box2d: [1.2.3]
flixel-addons: [1.1.0]
flixel-demos: [1.1.2]
flixel-tools: 1.1.0 [1.1.1]
flixel: [3.3.11] 3.3.8
hxargs: [3.0.0]
hxcpp: 3.2.102 [3.2.180]
layout: 1.2.0 [1.2.1]
lime-samples: 2.3.0 [2.6.0]
lime: 2.4.3 2.4.4 2.4.5 2.6.0 2.6.1 2.6.2 [2.6.8]
nape: [2.0.19]
openfl-bitfive: 3.0.0 3.3.2 3.3.3 [dev:/Users/johantheitguy/Source/project-cyanide/openfl-bitfive]
openfl-samples: 2.2.2 3.1.0 3.3.0 [3.3.1]
openfl: 3.0.1 3.1.0 3.3.1 3.3.2 3.3.3 [3.3.8]
sockjs: 1.0.0 [dev:/Users/johantheitguy/Source/project-cyanide/openfl-sockjs]
swf: 1.8.8 1.9.1 2.0.2 [2.1.1]
MBP20140603JVDB:DrawingShapes johantheitguy$ openfl test mac
Error: Could not find asset path "Assets"

Won't work with Openfl 2.1

I just updated the openfl to 2.1 (and lime to 2.0.0 alpha, as it was written: http://www.openfl.org/blog/2014/10/14/openfl-2-1/), but it won't work with the SimpleOpenglView sample. It says:

Source/Main.hx:214: characters 2-20 : Class<lime.graphics.opengl.GL> has no field uniformMatrix3D (Suggestions: uniformMatrix3fv, uniformMatrix4fv, uniformMatrix2fv)

[C#] After pausing sound, I can't click background anymore in PlayingSound example on cs

Actuate.tween (background, fadeOut, { alpha: 0.1 }); in line 60 somehow make background Sprite unclickable. Sprite fadeouts correctly, but becomes unclickable after finishing fadeout. background.alpha = 0.1; does not make background unclickable, so there might be some issue in actuate library.

As of lime 3.4.1 sound does not play on cs, because of a bug in AudioBuffer.fromFile, but I think this should be discussed in other issues.

Actuate.tween (background, fadeOut, { alpha: 0.1 });

Online samples

This is more of a question than an issue, but what do think about putting all the samples online? Either in a gh-pages branch in this repo, or on www.openfl.org?

lime samples showing for openfl

The following shows SimpleOpenGL as an openfl sample, even though I think it's a lime sample along with the bottom 3 in the list:

$ lime create openfl
You must specify a template when using the 'create' command.

 Usage: lime create library:project "com.package.name" "Company Name"
 Usage: lime create library:sample "OutputDirectory"
 Usage: lime create extension "ExtensionName"

 Available Samples: openfl

  - PiratePig
  - ActuateExample
  - PlayingSound
  - HandlingKeyboardEvents
  - HerokuShaders
  - SimpleOpenGLView
  - HandlingMouseEvents
  - DisplayingABitmap
  - AddingText
  - AddingAnimation
  - SimpleBox2D
  - HerokuShaders
  - SimpleOpenGL
  - SimpleAudioExample

Yet I can't build it:

$ lime update SimpleOpenGL html5
$ lime build SimpleOpenGL html5
Source/Main.hx:143: characters 2-86 : lime.gl.GLUniformLocation should be Int
Source/Main.hx:143: characters 2-86 : js.html.webgl.UniformLocation should be Int
Source/Main.hx:144: characters 2-84 : lime.gl.GLUniformLocation should be Int
Source/Main.hx:144: characters 2-84 : js.html.webgl.UniformLocation should be Int
Source/Main.hx:145: characters 2-65 : lime.gl.GLUniformLocation should be Int
Source/Main.hx:145: characters 2-65 : js.html.webgl.UniformLocation should be Int
Source/Main.hx:155: characters 34-39 : lime.utils.ByteArray should be haxe.io.Bytes
Source/Main.hx:155: characters 34-39 : lime.utils.html5.ByteArray should be haxe.io.Bytes
Source/Main.hx:155: characters 34-39 : For function argument 'b'
Source/Main.hx:198: characters 22-45 : Int should be lime.gl.GLUniformLocation
Source/Main.hx:198: characters 22-45 : Int should be js.html.webgl.UniformLocation
Source/Main.hx:198: characters 22-45 : For function argument 'location'
Source/Main.hx:199: characters 22-44 : Int should be lime.gl.GLUniformLocation
Source/Main.hx:199: characters 22-44 : Int should be js.html.webgl.UniformLocation
Source/Main.hx:199: characters 22-44 : For function argument 'location'
Source/Main.hx:200: characters 16-28 : Int should be lime.gl.GLUniformLocation
Source/Main.hx:200: characters 16-28 : Int should be js.html.webgl.UniformLocation
Source/Main.hx:200: characters 16-28 : For function argument 'location'

This is misleading and confusing if it is not an openfl sample.

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.