X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFrame.cpp;h=01264e8321921e4f2c55d0e14611c1547a9070fe;hb=77915e0186f4fc0788054eb34651c726b80d981c;hp=b51f093f6ad4b94b486e547e6f79d764aa42cc53;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/graphics/Frame.cpp b/src/graphics/Frame.cpp index b51f093..01264e8 100644 --- a/src/graphics/Frame.cpp +++ b/src/graphics/Frame.cpp @@ -126,12 +126,20 @@ void Frame::CreateTypeDescription() { int vectorId(TypeDescription::GetTypeId("Vector")); TypeDescription &td(TypeDescription::CreateOrGet("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("surface", FieldDescription(((char *)&f.surface) - ((char *)&f), imageId, true)); - td.AddField("borderSize", FieldDescription(((char *)&f.borderSize) - ((char *)&f), vectorId, false)); - td.AddField("repeatSize", FieldDescription(((char *)&f.repeatSize) - ((char *)&f), vectorId, false)); - td.AddField("offset", FieldDescription(((char *)&f.offset) - ((char *)&f), vectorId, false)); + td.AddField("image", FieldDescription(((char *)&f.surface) - ((char *)&f), imageId).SetReferenced().SetDescription("the underlying graphic from which the frame parts are cut")); + td.AddField("border", FieldDescription(((char *)&f.borderSize) - ((char *)&f), vectorId).SetDescription("size of the border part, dimensions of top-left corner")); + td.AddField("repeat", FieldDescription(((char *)&f.repeatSize) - ((char *)&f), vectorId).SetDescription("size of the repeat part, dimensions of a single tile of the background texture")); + td.AddField("offset", FieldDescription(((char *)&f.offset) - ((char *)&f), vectorId).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; } }