2019-08-18 21:44:32 +00:00
|
|
|
use swf::*;
|
|
|
|
|
|
|
|
fn main() {
|
2021-05-23 00:19:45 +00:00
|
|
|
let header = Header {
|
|
|
|
compression: Compression::Zlib,
|
|
|
|
version: 6,
|
|
|
|
stage_size: Rectangle {
|
|
|
|
x_min: Twips::from_pixels(0.0),
|
|
|
|
x_max: Twips::from_pixels(400.0),
|
|
|
|
y_min: Twips::from_pixels(0.0),
|
|
|
|
y_max: Twips::from_pixels(400.0),
|
2019-08-18 21:46:57 +00:00
|
|
|
},
|
2021-05-30 20:30:06 +00:00
|
|
|
frame_rate: Fixed8::from_f32(60.0),
|
2021-05-23 00:19:45 +00:00
|
|
|
num_frames: 1,
|
2019-08-18 21:46:57 +00:00
|
|
|
};
|
2021-05-23 00:19:45 +00:00
|
|
|
let tags = [
|
|
|
|
Tag::SetBackgroundColor(Color {
|
|
|
|
r: 255,
|
|
|
|
g: 0,
|
|
|
|
b: 0,
|
|
|
|
a: 255,
|
|
|
|
}),
|
|
|
|
Tag::ShowFrame,
|
|
|
|
];
|
2019-08-18 21:46:57 +00:00
|
|
|
let file = std::fs::File::create("tests/swfs/SimpleRedBackground.swf").unwrap();
|
|
|
|
let writer = std::io::BufWriter::new(file);
|
2021-05-23 00:19:45 +00:00
|
|
|
swf::write_swf(&header, &tags, writer).unwrap();
|
2019-08-18 21:44:32 +00:00
|
|
|
}
|