slide.items[1].text.justify = Slide_Item_Text.Justify.Left;
slide.items[2] = slideshow_make_item(^the_slideshow);
- slide.items[2].kind = Slide_Item.Kind.Text;
- slide.items[2].text.text = "Here is a block of much longer text that will not wrap correctly, which is annoying but I think the best thing to do is... I don't know yet.";
- slide.items[2].text.y_pos = .45;
- slide.items[2].text.font_name = "Calibri";
- slide.items[2].text.font_size = 36;
- slide.items[2].text.padding = .07;
- slide.items[2].text.justify = Slide_Item_Text.Justify.Left;
+ slide.items[2].text = Slide_Item_Text.{
+ text = "Here is a block of much longer text that will not wrap correctly, which is annoying but I think the best thing to do is... I don't know yet.",
+ y_pos = .45,
+ font_name = "Calibri",
+ font_size = 36,
+ padding = .07,
+ justify = Slide_Item_Text.Justify.Left,
+ };
}
}
}
Slide_Item_Text :: struct {
- use base : Slide_Item_Base;
+ use base := Slide_Item_Base.{ Slide_Item.Kind.Text };
- color : Color;
+ color : Color = Color.{ 1, 1, 1 };
font_name : str;
font_size : u32;
- font_attr : FontAttributes;
+ font_attr : FontAttributes = ~~ 0;
FontAttributes :: enum #flags { Bold; Italic; Underline; }
Justify :: enum { Left; Center; Right; }
}
+Slide_Item_Image :: struct {
+ use base := Slide_Item_Base.{ Slide_Item.Kind.Text };
+
+ path : str;
+ x, y : f32; // Between 0 and 1
+ width : f32; // Between 0 and 1
+
+ // Currently the image maintains the original aspect ratio,
+ // so the height of the image is automatically determined.
+}
+
slideshow_make :: (allocator := context.allocator) -> Slideshow {
}
}
}
+
+ case Image {
+ assert(false, "Slide_Item_Image not implemented!");
+ }
}