Xandal_Fi Newbie
Posts : 24 Thanked : 2 Engine : RMVX Ace Skill : Intermediate Type : Event Designer
| Subyek: [VXA] CENTERING About Window Choice 2013-01-01, 16:07 | |
| [VXA] Centering Position of Window Choice & Choice Texts Versi: 1.0
PengenalanScript untuk memindahkan posisi Window Choice jadi di tengah dan bikin Text dari Choice tersebut jadi CENTER. Fitur
- Posisi Window Choice jadi di Tengah
- Text dari Choice jadi CENTERed
ScreenshotsNote:
- Hanya aktif jika Text Choice 1 panjang, jika pendek akan menjadi seperti ini:
DemoScript saja cukup. Scriptshttp://pastebin.com/g2JeKXYi Special Thanks
- Enterbrain's Scripts
- Galv's Scripts
- Myself
| |
|
Heartbreak61 Novice
Posts : 177 Thanked : 4 Engine : RMVX Ace Skill : Very Beginner Type : Event Designer
| Subyek: Re: [VXA] CENTERING About Window Choice 2013-01-03, 12:11 | |
| idenya boleh juga, =w=/ langsung ane komeng ya (agak pedes tapi no offense ) - method yang tidak direwrite ga perlu ditulis, buang2 waktu,tenaga,pikiran, dan size - usahakan ke depan ngasih list method2 mana yang direwrite dan di alias - kalo bisa user dikasih pilihan (contohnya mau bikin center, left, ato right) bonus: bugfix + contoh ngasih pilihan - Spoiler:
- Code:
-
# rewrite: Window_ChoiceList.update_placement # new: Window_ChoiceList.item_rect_for_text
module Choice # ganti dengan :left, :right, atau :center WINDOW_POSITION = :center TEXT_POSITION = :center end
class Window_ChoiceList < Window_Command include Choice def update_placement self.width = [max_choice_width + 12, 96].max + padding * 2 self.width = [width, Graphics.width].min self.height = fitting_height($game_message.choices.size) case Choice::WINDOW_POSITION when :right self.x = (Graphics.width - width) when :center self.x = (Graphics.width - self.width)/ 2 when :left self.x = padding end if @message_window.y >= Graphics.height / 2 self.y = @message_window.y - height else self.y = @message_window.y + @message_window.height end end # New Method def item_rect_for_text(index) rect = item_rect(index) text = $game_message.choices[index] mid_point = (max_choice_width - text_size(text).width + padding )/2 # right_point ditambah 4 biar text yang terpanjang posisinya sama kaya # kalo dipasang di left right_point = max_choice_width - text_size(text).width + 4 case Choice::TEXT_POSITION when :left rect.x += 4 when :center rect.x = mid_point when :right rect.x = right_point end rect.width -= 8 rect end end
selamat scripting | |
|