lucas34 / Scyla

Canvas engine for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scyla

Canvas engine for Android

Scyla is a rotation safe canvas engine for Android. Available on maven. It's run inside a fragment so you can use it wherever you want !

Add Dependency

Gradle dependency

compile 'fr.nelaupe:scyla:1.1.2@aar'

Maven dependency

<dependency>
    <groupId>fr.nelaupe</groupId>
    <artifactId>scyla</artifactId>
    <version>1.1.2</version>
</dependency>

Sample

How simple is to create an "Hello word" that you can drag ?

public class myView extends ScylaCanvasView {
	
	public myView(ViewHandler handler, Context context) {
		super(handler, context);
	}

	@Override
	public void addCustomElements(Scene scene, GridTemplate grid) {
		final Text txt = new Text(context(), "Hello world", grid.getCenter());
		scene.addStaticElement(txt);
		
		this.subscribeTouchListener(txt,new TouchEvent() {
			@Override
			public void onTouch(Point point, TouchTypeEvent event) {
				if(event == TouchTypeEvent.Move){
					txt.gravityCenterFacet().moveGravityCenterTo(point);
				}
			}
		});
	}

}

Applications that use Scyla

Contributors

License

Licensed under the Apache License, Version 2.0

About

Canvas engine for Android.

License:Apache License 2.0


Languages

Language:Java 100.0%