Sha256: b4657ee3f24e49fb15fdeab33c1937bcc0c69e50a5a51d05ec1109cbf9456e64

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

module Bioshogi
  module ScreenImage
    concern :TurnMethods do
      class_methods do
        def default_params
          super.merge({
              :turn_embed_key => "is_turn_embed_off",  # 現在の手数を埋めるか?
            })
        end
      end

      def turn_draw(layer)
        if params[:turn_embed_key] == "is_turn_embed_on"
          logger.info "turn_draw"

          pointsize = cell_w * 0.75
          w = pointsize * 4
          h = pointsize
          x = pointsize * 0.3
          y = pointsize * 0.1

          # r = cell_w * 0.5
          # @d_turn_layer = Magick::Image.new(w, h) { |e| e.background_color = "transparent" }

          # gc = Magick::Draw.new
          # gc.fill(params[:piece_count_bg_color])
          # from = [x + w/2, y + h/2]
          # to   = [x + w/2 + r, y + h/2]
          # gc.circle(*from, *to)
          # gc.draw(@d_turn_layer)

          gc = Magick::Draw.new
          gc.annotate(layer, w, h, x, y, "#{@build_counter}") do |e|
            e.font         = params[:font_bold].to_s
            e.fill         = "hsla(0,0%,100%,1.0)"
            e.pointsize    = pointsize
            e.stroke_width = 2
            e.stroke       = "hsla(0,0%,0%,0.75)"
            e.gravity      = Magick::NorthWestGravity
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bioshogi-0.0.15 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.14 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.10 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.9 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.8 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.7 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.5 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.4 lib/bioshogi/screen_image/turn_methods.rb
bioshogi-0.0.3 lib/bioshogi/screen_image/turn_methods.rb