import com.cult3d.*;
import com.cult3d.world.*;

import java.awt.*;
import java.awt.image.*;

// The TextBox Example
public class Example8 implements Cult3DScript
{
	Texture  tex;
	Resource res;

	Image im, bgim;
	Graphics g;

	byte[] data;
	int w;
	int h;
	String s;

	public Example8()
	{
		tex = new Texture("Vulcano");
		res = new Resource("t.txt");
		
		bgim = Cult.getImage("Vulcano.jpg");
		data = res.getResource();
		
		s = new String(data);
		w = tex.getWidth();
		h = tex.getHeight();

		im = (TextureImage)Cult.createImage(w,h);
		g = im.getGraphics();
		
		g.setFont(new Font("Times", Font.PLAIN, 20));
	}

	public void cultEvent(String event)
	{
		g.drawImage(bgim,0,0, null);
		g.drawString(s, 0,40);
		if(s.length() >0);
			s = s.substring(1);
		tex.setTexture(im);
	}

	public void cult3dDestroy()
	{
	}
}
