Skip to content

Instantly share code, notes, and snippets.

@skymonsters-Ks
skymonsters-Ks / shake.hsp
Created September 20, 2021 17:49
viewcalcで画面を揺らす
#include "hsp3dish.as"
wx = 854
wy = 480
screen 0, wx, wy
es_ini
buffer 1
picload dir_tv + "ball64.png"
es_size 64, 64
@skymonsters-Ks
skymonsters-Ks / scroll.hsp
Last active April 30, 2020 01:46
ラスタースクロール的なやつ
#const RECT 32
#const WIN_W 16 * RECT
#const WIN_H 10 * RECT
screen 0, WIN_W, WIN_H
buffer 1, WIN_W * 2, WIN_H * 2
repeat WIN_W * 2 / RECT : w = cnt
repeat WIN_H * 2 / RECT : h = cnt
x = w * RECT * 2 + h \ 2 * RECT
@skymonsters-Ks
skymonsters-Ks / fw_test1.hsp
Last active February 8, 2020 14:57
ウィンドウとフルスクリーンの切替
; #include "hgimg4.as" ; HGIMG4 は HSP3.6b2 以降
#include "user32.as"
#module
#const GWL_STYLE -16
#const WS_POPUP $80000000
#const WS_VISIBLE $10000000
#const WM_KILLFOCUS $8
#const WM_GETMINMAXINFO $24
#const SCALE 1
screen 0, 1600, 900
ox = double(ginfo_sx / 4), ox * 3
oy = double(ginfo_sy / 2), oy
x = ox, ox.1
y = oy, oy
randomize
a = hwnd, a
cf = 1
@skymonsters-Ks
skymonsters-Ks / NppHspLang.xml
Last active January 19, 2020 09:11
Notepad++用 HSP(3.6 beta2) 自動補完キーワードとシンタックスハイライト
<NotepadPlus>
<UserLang name="HSP" ext="hsp as" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="yes" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00; 00// 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2">% $ 0b 0x</Keywords>
@skymonsters-Ks
skymonsters-Ks / dispinfo.hsp
Created December 28, 2019 02:27
(マルチ)ディスプレイの解像度などの情報表示
#include "user32.as"
#include "gdi32.as"
#ifndef SetProcessDPIAware
#uselib "user32"
#func SetProcessDPIAware "SetProcessDPIAware"
#endif
#uselib "shcore"
#func SetProcessDpiAwareness "SetProcessDpiAwareness" int
@skymonsters-Ks
skymonsters-Ks / hspcon_list.hsp
Last active November 2, 2019 00:56
HSPプログラムコンテストの作品をリスト&カウント
; Enterキーで選択中の作品ページを開きます
#include "hspinet.as"
#define URL_BASE "dev.onionsoft.net/seed/info.ax?id="
#define PROTOCOL "https://"
netinit
if stat : dialog "connection error" : end
@skymonsters-Ks
skymonsters-Ks / km-input.hsp
Last active May 19, 2019 05:11
キーボードマニア専用コントローラの入力を取得するHSPモジュール(サンプル動かすには途中の #if 0 を #if 1 にしてください)
/*
キーボードマニア専用コントローラ入力取得モジュール
24鍵とスタート・セレクトボタン、ホイール上下の入力、複数のコントローラ対応
license: NYSL 0.9982 (http://www.kmonos.net/nysl/)
tested: HSP 3.5b4
*/
#module kminput
@skymonsters-Ks
skymonsters-Ks / space.hsp
Last active March 31, 2019 06:37
宇宙を進む
randomize
screenW = ginfo_sx
screenH = ginfo_sy
centerX = screenW / 2
centerY = screenH / 2
num = 200
ddim posx, num
ddim posy, num
@skymonsters-Ks
skymonsters-Ks / palanime.hsp
Last active January 13, 2019 16:22
パレットモードでパレットアニメーション (tested with HSP 3.51)
#const HUE_RANGE 192
screen 0, 640, 480, 1
mes "Initializing..."
screenW = ginfo_sx
screenH = ginfo_sy
centerX = screenW / 2
centerY = screenH / 2