Skip to content

Instantly share code, notes, and snippets.

@narumitukasa
narumitukasa / gist:32b2a1565e1b5e722aec6fe1f60c6e17
Created December 21, 2016 22:47
領域を広げて表示をシフトする
#文字用のimageを作成
@entity.dispose if @entity and !(@entity.disposed?)
@entity = DXRuby::Image.new(@width+64, @height+64, [0, 0, 0, 0])
self.offset_sync = true
self.center_x = 32
self.center_y = 32
#フォントを描画
@entity.draw_font_ex( offset_x+32,
offset_y+32,
@narumitukasa
narumitukasa / gist:592e4086134b13fafc60536a2bff416f
Created December 18, 2016 16:04
ホラー風文字描画
# encoding: utf-8
require 'dxruby'
class HorrorText < DXRuby::Shader
# シェーダコアのHLSL記述
hlsl = <<EOS
// (1) グローバル変数
float waveAmpU;
float waveAmpV;
#イベントポイントの作成
_DEFINE_ :event_point do |id:, x:, y:, width:, height: |
_SEND_ [:screen] do
_BUTTON_BASE_ id: id, width: width, height: height, x: x, y: y do
#背景
_CREATE_ :DrawableLayout, id: :bg,
width: width, height: height, bgcolor: [128, 255, 0, 0]
@narumitukasa
narumitukasa / gist:d185c0f38e78c5681ea0
Created December 29, 2014 10:46
WSFloatingWindowテスト
#coding: utf-8
module WS
module FloatingWindow
def priority
(super + 2)
end
end
class WSControl
@narumitukasa
narumitukasa / gist:7aa493043dc49d1ab405
Created November 30, 2014 11:23
コンテナを後から追加可能なSplitContainerテスト
# coding: utf-8
require 'dxruby'
require_relative '../lib/dxrubyws'
require_relative '../lib/standardgui'
require_relative '../lib/fontcache'
module WS
class SeparatorTest < WSWindow
def initialize
super(100,100,400,300)
@narumitukasa
narumitukasa / gist:d600f7497e05e3ef53ff
Created November 29, 2014 14:30
ステータスウィンドウをWSで作ろう
# coding: utf-8
require 'dxruby'
require_relative '../lib/dxrubyws'
require_relative '../lib/standardgui'
WS.set_theme("guibasic")
Window.width, Window.height = 1280, 720 # ワイド画面化
module Game