赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 163587 |
最后登录 | 2020-5-5 |
在线时间 | 41 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 41 小时
- 注册时间
- 2008-3-5
- 帖子
- 2072
|
本帖最后由 hitlerson 于 2011-1-8 16:29 编辑
不是draw_text的问题吧
我这个显示卡片信息的鼠标来回拖,显示一点都不卡
- #---------------------------------------------------------------------------
- # ● 描绘全卡片
- #---------------------------------------------------------------------------
- def a_draw_item(index,n=0)
- return if @dataa[index] == nil
- card_id = @dataa[index][0]
- number = @dataa[index][1]
- index -= @n
- x = 554
- y = index*44 + 76
- return if index > 9
- return if index < 0
- @card_bitmap_a = [] if @card_bitmap_a == nil
- @card_bitmap_b = [] if @card_bitmap_b == nil
- @card_bitmap_a[index] = Sprite.new(@viewport5)
- @card_bitmap_a[index].x, @card_bitmap_a[index].y = x, y
- @card_bitmap_a[index].z = index + 1000
- bitmap = RPG::Cache.picture("card/#{CARD::CARD[card_id][1][0]}")
- @card_bitmap_a[index].bitmap = bitmap
- @card_bitmap_b[index] = Sprite.new(@viewport5)
- @card_bitmap_b[index].x, @card_bitmap_b[index].y = x, y
- @card_bitmap_b[index].z = index + 10000
- #@card_bitmap_b[index].bitmap = bitmap
- @card_bitmap_b[index].bitmap = Bitmap.new(160,32)
- @card_bitmap_b[index].bitmap.font.size = 12
- #@card_bitmap_b[index].bitmap.font.color = Color.new(255,255,255,255)
- @card_bitmap_b[index].bitmap.draw_text(26, -6 , 212, 32, CARD::CARD[card_id][0].to_s, 0)
- @card_bitmap_b[index].bitmap.draw_text(26, 8 , 16, 32, CARD::CARD[card_id][2][3].to_s, 1)
- @card_bitmap_b[index].bitmap.draw_text(40, 8 , 24, 32, CARD::CARD[card_id][2][4].to_s, 2)
- @card_bitmap_b[index].bitmap.draw_text(65, 8 , 24, 32, CARD::CARD[card_id][2][5].to_s, 2)
- @card_bitmap_b[index].bitmap.draw_text(0 , 10, 24, 32, number.to_s, 2)
- @card_bitmap_a[index].zoom_x, @card_bitmap_a[index].zoom_y = 0.1, 0.1
- end
复制代码 |
|