+
+void Frame::CreateTypeDescription() {
+ Frame f;
+
+ TypeDescription &td(TypeDescription::Create(TYPE_ID, "Frame"));
+ td.SetDescription(
+ "A frame is basically a border + a background texture.\n"
+ "It splits an image into 3*3 parts where the edges are kept as is and the sides and the middle part are repeated as needed.");
+ td.SetConstructor(&Construct);
+ td.SetSize(sizeof(Frame));
+
+ td.AddField("image", FieldDescription(((char *)&f.surface) - ((char *)&f), Interpreter::IMAGE_ID).SetReferenced().SetDescription("the underlying graphic from which the frame parts are cut"));
+ td.AddField("border", FieldDescription(((char *)&f.borderSize) - ((char *)&f), Interpreter::VECTOR_ID).SetDescription("size of the border part, dimensions of top-left corner"));
+ td.AddField("repeat", FieldDescription(((char *)&f.repeatSize) - ((char *)&f), Interpreter::VECTOR_ID).SetDescription("size of the repeat part, dimensions of a single tile of the background texture"));
+ td.AddField("offset", FieldDescription(((char *)&f.offset) - ((char *)&f), Interpreter::VECTOR_ID).SetDescription("offset into the image where to start cutting, coordinates of the top-left corner on the image"));
+}
+
+void Frame::Construct(void *data) {
+ new (data) Frame;
+}
+