hengmana   06-08-2017, 10:43 PM
#9
- แก้ภาพตัวละคร ให้ใหญ่ขึ้น
คำสั่งโชว์ ตัว character ในช่อง Window_MenuStatus
Quote: draw_actor_graphic(actor, x - 40, y + 80)
แล้วหา ตัวสร้างคำสั่ง draw_actor_graphic นี้ขึ้นมา (คลิ้กขวาตรงช่องแลัวกดค้นหา)อยู่ในช่อง
Show ContentSpoiler:
Code:
def draw_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
จะแก้ข้างใน หรือ ก็อปสร้างอันใหม่เปลื่ยนชื่อใหม่ต่อข้างล่าง ก็แล้วแต่
โดยคำสั่ง โชว์รูปปกติ self.contents.blt
Quote:self.contents.blt(x, y, bitmap, src_rect)
และกำหนดตำแหน่งอาณาเขตช่องที่จะโชว์รูปแค่ไหน
Quote:src_rect = Rect.new(ตำแหน่งx, ตำแหน่งy, โชว์ความกว้างจากซ้ายไปขวา, โชว์ความสูงจากบนลงล่าง)

เปลี่ยนคำสั่งใหม่ โชว์รูปขยาย self.contents.stretch_blt
ตัวอย่าง ขยาย *2 (size = 2)
Code:
def draw_actor_graphic(actor, x, y)
        bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
       size = 2    
       cw = bitmap.width / 4
       ch = bitmap.height / 4
       src_rect = Rect.new(0, 0, cw, ch)
       dest_rect = Rect.new(x - (cw * size / 2), y -  (ch * size / 2), cw *size, ch *size)
       self.contents.stretch_blt(dest_rect, bitmap, src_rect)
    end
โดย dest_rect = Rect.new(ตำแหน่งx, ตำแหน่งy, ขยายความกว้างจากซ้ายไปขวา, ขยายความสูงจากบนลงล่าง)


- แก้ในส่วน ไอค่อนกับตัวอักษรที่ทับกันมั่วมาก อยากจะเอา ภาพไอค่อนไว้ทางซ้ายของเมนูครับ
Quote:def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
ไว้ใส่คำสั่งโชว์รูป
self.contents.draw_text(rect, @commands[index])
end
แก้เป็น
rect = Rect.new(4 + 26, 32 * index, self.contents.width - 8 - 26, 32)
ตรง 4 ให้+เพิ่ม 26 ขยับtextไปทางขวาเล็กน้อย แล้ว (- 26) ลดอาณาเขตtextให้แคบลง
This post was last modified: 06-09-2017, 03:23 PM by hengmana.
  
Users browsing this thread: 1 Guest(s)
Powered By MyBB, © 2002-2024 MyBB Group.
Made with by Curves UI.