HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2020
0717
ぱお子ウィンドウを使用したアニメーションで質問があります。2解決


ぱお

リンク

2020/7/17(Fri) 17:45:51|NO.91010

子ウィンドウを加減速ありで動かすアニメーションを作ったのですが、Yの座標がマイナス以下になると
子ウィンドウのアニメーションがおかしくなります。
以下のソースはYを-100から250まで減速しながら移動させるものです。
子ウィンドウはY座標がマイナス以下を指定した場合に挙動がおかしくなるのは仕方のないことなのでしょうか。


screen 0,1280,680,0,0,0 #uselib "gdi32" #cfunc CreateRoundRectRgn "CreateRoundRectRgn" int, int, int, int, int, int #uselib "user32" #func SetWindowRgn "SetWindowRgn" int, int, int #uselib "user32" #func SetParent "SetParent" int, int ParentHwnd = hwnd bgscr 998, 390,100,0,500,20 SetParent hwnd, ParentHwnd hRegion = CreateRoundRectRgn(0, 0, 390, 500, 50, 50) SetWindowRgn hwnd, hRegion, 1 color 120,120,120:boxf Window_X_Calculation=1280-ginfo(10);1280-ダイアログのXサイズ Window_X=Window_X_Calculation/2 i=0 Window_Ani_Y=0 repeat 45 setease -100,250,ease_quartic_out Window_Ani_Y = getease(i,50) width ,,Window_X,Window_Ani_Y i=i+1 await 50 loop gsel 0,1

これについて解決できる方法があれば教えていただきたいです。
前回に引き続き初歩的な質問ですいません...



この記事に返信する


あらや

リンク

2020/7/17(Fri) 18:42:01|NO.91012

widthに関するヘルプを見てもらえばわかると思いますが

>p1,p2およびp3,p4パラメータが省略されるか、またはマイナス値の場合は、現在の設定が使われます。

と書かれているようにウィンドウの位置もサイズもマイナスを指定すると
現状維持という意味になってしまいます。

位置にマイナスを指定する場合はAPIのMoveWindow関数を使用すれば
期待通りの結果になるかと思います。


screen 0,1280,680,0,0,0 #uselib "gdi32" #cfunc CreateRoundRectRgn "CreateRoundRectRgn" int, int, int, int, int, int #uselib "user32" #func SetWindowRgn "SetWindowRgn" int, int, int ;#uselib "user32" // 2度目は不要 #func SetParent "SetParent" int, int #func MoveWindow "MoveWindow" int, int, int, int, int, int // 追加 ParentHwnd = hwnd bgscr 998, 390,100,0,500,20 SetParent hwnd, ParentHwnd hRegion = CreateRoundRectRgn(0, 0, 390, 500, 50, 50) SetWindowRgn hwnd, hRegion, 1 color 120,120,120:boxf Window_X_Calculation=1280-ginfo(10) Window_X=Window_X_Calculation/2 i=0 Window_Ani_Y=0 repeat 45 setease -100,250,ease_quartic_out Window_Ani_Y = getease(i,50) ;width ,,Window_X,Window_Ani_Y // 削除 MoveWindow hWnd, Window_X, Window_Ani_Y, ginfo_winx, ginfo_winy, 1; // 変更 i=i+1 await 50 loop gsel 0,1



ぱお

リンク

2020/7/18(Sat) 21:22:29|NO.91031

MoveWindowというものを使えば行けるのですね!!
前回に引き続き今回もありがとうございます!!



ONION software Copyright 1997-2023(c) All rights reserved.