|
MT4j/examples/svgExample/StartExample.java
package svgExample;
import org.mt4j.MTApplication;
public class StartExample extends MTApplication{
private static final long serialVersionUID = 1L;
public static void main(String args[]){
initialize();
}
@Override
public void startUp(){
this.addScene(new SVGScene(this, "Svg scene"));
}
}
MT4j/examples/svgExample/SVGScene.java
package svgExample;
import java.io.File;
import org.mt4j.MTApplication;
import org.mt4j.components.visibleComponents.widgets.MTSvg;
import org.mt4j.sceneManagement.AbstractScene;
import org.mt4j.util.math.Vector3D;
public class SVGScene extends AbstractScene {
public SVGScene(MTApplication mtApplication, String name) {
super(mtApplication, name);
this.setClearColor(255, 255, 255, 255);
MTSvg svg = new MTSvg(mtApplication,
System.getProperty("user.dir")+File.separator + "examples"+ File.separator +"svgExample"+ File.separator + "data" + File.separator +
"windmill.svg");
svg.setPositionGlobal(new Vector3D(mtApplication.width/2, mtApplication.height/2,0));
this.getCanvas().addChild(svg);
MTSvg butterFly = new MTSvg(mtApplication, System.getProperty("user.dir")+File.separator + "examples"+ File.separator +"svgExample"+ File.separator + "data" + File.separator +
"butterfly.svg");
butterFly.setPositionGlobal(new Vector3D(300, 100,0));
this.getCanvas().addChild(butterFly);
this.getCanvas().addChild(new MTSvg(mtApplication,System.getProperty("user.dir")+File.separator + "examples"+ File.separator +"svgExample"+ File.separator + "data" + File.separator +
"primitives.svg"));
}
@Override
public void init() {
}
@Override
public void shutDown() {
}
}
contact
|
|