How to setup my KorGE project to use Fleks ECS library? - kotlin

I want to use Fleks ECS as shown in this example:
https://github.com/korlibs/korge-next/tree/main/samples/fleks-ecs
How to setup my KorGE project to be able to import the Fleks library?

I found that there is a built in function to import the Fleks into KorGE project.
Just configure the build.gradle.kts file as in the example below:
...
korge {
id = "com.example.mygame"
name = "My Game"
supportFleks()
targetJvm()
targetJs()
targetDesktop()
targetIos()
targetAndroidIndirect() // targetAndroidDirect()
}

Related

How to customize WAR plugin in subproject in Gradle build script (Kotlin)

I create a Gradle project with several sub-modules, and one module needs war plugin, I just want to customize the web app directory, but the code does not work:
apply {
plugin("war")
plugin("org.gretty")
}
// cannot work
tasks.getByName("war") {
from("src/main/webfiles")
}
// cannot work either
tasks.war {
webAppDirName = "src/main/webfiles"
}
//... other code
This is how I code in the sub-project subproject.gradle.kts file, How to solve this? Thanks for any help!
Solved with the code:
configure<WarPluginConvention>{
webAppDirName = "src/main/webfiles"
}

How to bundle a plugin which requires multiple files in order to work

I'm facing an issue when I try to bundle Aurelia-hammer with the CLI.
The app still keeps pulling hammer-swipe.js, hammer-tap.js,... from the node_modules folder.
When I inspect the plugin's AMD structure, these are defined as global resources:
function configure(frameworkConfig) {
frameworkConfig.globalResources('./hammer-swipe');
frameworkConfig.globalResources('./hammer-tap');
frameworkConfig.globalResources('./hammer-press');
frameworkConfig.globalResources('./hammer-hold');}
Is there any way to bundle these with the CLI? I tried adding these files to the "resources" element in aurelia.json without success.
the plugin author should export those classes: (HammerPressCustomAttribute...) so they could be traced properly. But you can dummy-import theme yourself as a workaround:
import { HammerPressCustomAttribute } from 'aurelia-hammer/hammer-press';
import { HammerSwipeCustomAttribute } from 'aurelia-hammer/hammer-swipe';
import { HammerTapeCustomAttribute } from 'aurelia-hammer/hammer-tap';
normally you have to do this as well:
import { HammerHoldCustomAttribute } from 'aurelia-hammer/hammer-hold';
but the class exported from hammer-hold.js is named HammerPressCustomAttribute (oops looks like copy-paste issue) so just reference the file even with a non existent class.
import { HammerHoldCustomAttribute } from 'aurelia-hammer/hammer-hold';
this should fix your problem (I hope). It's best to open an issue in the plugin repo and ask the author to export those classes (and rename the duplicate one).

Noflo I get error when trying to print an input

I have app.js that looks like:
var noflo = require("noflo");
var graph = noflo.graph.createGraph("PrintValueGraph");
graph.addNode("output", "Print");
graph.addInitial(100,"output","in");
var network = noflo.createNetwork(graph);
And I have a Print.coffee script in the same dir, that has the same code as Output.coffee on the noflo-core folder.
I get the error: no process defined for inbound node output.
Do u have any idea, what the problem is?
Thanks
You must declare the Print component in the package.json
"noflo": {
"components": {
"Print": "./Print.coffee"
}
}
Components need to be registered in the package.json (or component.json for the browser) for the NoFlo ComponentLoader to find them.
See example: https://github.com/c-base/ingress-table/blob/master/package.json#L41
There is also the grunt-noflo-manifest package that can automate this for you.
The convention is to keep your components in a components/ subdirectory inside your project.

Creating a package under source folder when developing an eclipse plugin

I am developing an Eclipse wizard that will be used for creating a project. I can create the folder hieararchy but I cannot create a package under "src" folder. I found this answer How to create packages (folders) in an Eclipse project via plugin here. However, it does not solve my problem. When I create a folder under "src" folder, eclipse does not recognize it as a package. How can I do this?
Try this using JDT API as below.
private void createPackage(IProject project) throws JavaModelException {
IJavaProject javaProject = JavaCore.create(project);
IFolder folder = project.getFolder("src");
// folder.create(true, true, null);
IPackageFragmentRoot srcFolder = javaProject
.getPackageFragmentRoot(folder);
IPackageFragment fragment = srcFolder.createPackageFragment(project.getName(), true, null);
}
for more help please access this link

ActionScript 2.0 Import package into Timeline script

All,
I have been trying to import some sample actionscript package into my flash project.
The sample code is defined in the org.red5.flash.bwcheck package.
In my flash project's (flash 8 and actionscript 2.0) actions frame:
I added these lines at the beginning:
import org.red5.flash.bwcheck.app.*;
import org.red5.flash.bwcheck.events.*;
import org.red5.flash.bwcheck.*;
and add the call to this package in my code
function start()
{
serverURL = settingsManager.getIP();
serverApplication = "live";
clientServerService = "checkBandwidthUp";
serverClientService = "checkBandwidth";
trace("calling connect()");
connect();
}
The connect() is a function defined org.red5.flash.bwcheck.app.BandwidthDetectionApp.
Nothing happens when I test the movie.
I added these paths to both action script 2.0's settings and project preferences:
./org/red5/flash/bwcheck
./org/red5/flash/bwcheck/app
./org/red5/flash/bwcheck/events
when I test or debug movie, the connect() does not seem to be called.
If I called the connect with the full path name:
Then I got a lot of syntax errors about the sample code which should not have errors.
My question is how do I import package and use it in my Actions Frame?
Thanks,
Peter