<> #ifndef _ANIMATION_LIB_H #define _ANIMATION_LIB_H /* animation_lib.h アニメーションサンプルウィジェット集のヘッダ */ /* GDKでアニメーションgifを読み込むサンプルウィジェット */ GtkWidget *my_pixbuf_animation(GtkWidget *window); /* ボールが動くアニメーションサンプルウィジェット */ GtkWidget *my_animation_ball(GtkWidget *window, gboolean trans); /* アニメーションgifが動くアニメーションサンプルウィジェット */ GtkWidget *my_animation_earth(GtkWidget *window, gboolean trans); /* キャラクターが動くアニメーションサンプルウィジェット */ GtkWidget *my_animation_chara(GtkWidget *window,GtkWidget *window2, gboolean trans); #endif <> static struct{ int up; int right; int down; int left; int w; int d; int s; int a; int f; int r; int ctrl; int shift; } sg_keys = {FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE}; static struct{ int punch1; int punch2; int kick1; int kickk2; int guard1; int guard2; }hit={FALSE,FALSE,FALSE,FALSE,FALSE,FALSE}; static struct{ /*しょうごステータス*/ int y_hp; int y_at; int y_def; int y_sp; }yama={6000, 500, 200, 3}; static struct{ /*おおともステータス*/ int o_hp; int o_at; int o_def; int o_sp; }otm={6000, 200, 200, 5}; static struct{ /*だいやステータス*/ int d_hp; int d_at; int d_def; int d_sp; }daiya={5000, 100, 100, 7}; static struct{ /*かなめステータス*/ int k_hp; int k_at; int k_def; int k_sp; }kaname={6000, 200, 400, 4}; static struct{ /*たくみステータス*/ int t_hp; int t_at; int t_def; int t_sp; }takumi={6000, 300, 200, 5}; static struct{ /*たさきステータス*/ int ta_hp; int ta_at; int ta_def; int ta_sp; }tasaki={6000, 300, 100, 5}; <> #ifndef _GDK_PIXBUF_LIB_H #define _GDK_PIXBUF_LIB_H /* gdk_pixbuf_lib.h gdk-pixbufであれこれするサンプルウィジェット集のヘッダ */ #include /* 画像を読み込むサンプルウィジェット */ GtkWidget *my_pixbuf_image(char *filename); /* 画像の拡大・縮小のサンプルウィジェット */ GtkWidget *my_pixbuf_scale(void); /* 画像の回転のサンプルウィジェット */ GtkWidget *my_pixbuf_rotate(void); /* 画像を半透明にするサンプルウィジェット */ GtkWidget *my_pixbuf_alpha(void); #endif # include //gtkの機能をまとめて使うためのインターフェイス typedef PangoFontDescription My_Font_Desc; // 初期化 // とにかく実行直後に呼んでおくこと void my_init(int argc, char *argv[]); // ウィンドウの作成 // 600x480, 枠の幅が15pixel GtkWidget * my_window_new(void); // ラベル付きボタンの作成 GtkWidget * my_button_new(char *label, My_Font_Desc *fontdescription); // イメージの作成 GtkWidget * my_image_new(char *path); // フォントの取り扱い My_Font_Desc *my_font_description(const gchar *fontname); // イベント処理 (コールバック) 関数 gint my_close_handler(GtkWidget *widget, gpointer gdata); void my_button_clicked_handler(GtkWidget *widget, gpointer data);