{{htmlmetatags>metatag-robots=() metatag-media-og:image=(:developer_center:developer_editor:khanhtv_8.png?)}} ====== ★ Trigger UI Thanh Máu ====== \\ ==== Trigger Hoạt Động ==== {{ :developer_center:developer_editor:ui_health_bar_0_.mp4?direct&600 |}} ---- ==== Tạo UI theo mẫu ( Lưu ý cách sắp xếp ) ==== {{ :developer_center:developer_editor:ui_health_bar__1_.png?direct&600 |}} * **Bước 1:** Tạo UI hình ảnh "Nền" để chứa các UI tạo sao này {{ :developer_center:developer_editor:ui_health_bar__2_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__3_.png?direct&600 |}} * **Bước 2:** Tạo UI hình ảnh "Thanh HP" thành phần con của UI "Nền" thiết lập vị trí trung tâm bên trái, ghi nhớ độ rộng thành phần này {{ :developer_center:developer_editor:ui_health_bar__4_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__5_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__6_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__7_.png?direct&600 |}} * **Bước 3:** Tạo UI văn bản "Thông tin" phần con của UI "Nền" chỉnh độ rộng thích hợp để hiện thị văn bản ( phù hợp nhất-chỉnh rộng ngang UI "Nền" ), thiết lập văn bản căn giữa {{ :developer_center:developer_editor:ui_health_bar__8_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__9_.png?direct&600 |}} ---- * **Bước 1:** Tạo mã tùy chỉnh để thuận tiện cho các chức năng phát triển sau này {{ :developer_center:developer_editor:ui_health_bar__10_.png?direct&60 |}}\\ {{ :developer_center:developer_editor:ui_health_bar__11_.png?direct&600 |}} * **Bước 2:** Thêm thêm hành động thay đổi kích thước UI, thiết lập thay đổi kích thước UI "Thanh HP" với thời gian thích hợp thay đổi đến giá trị: Chiều rộng tối đa ban đầu thiếp lập ( theo mẫu là 320 ) × [ Giá trị HP hiện tại của người chơi ÷ Giá trị HP tối đa của người chơi ] {{ :developer_center:developer_editor:ui_health_bar__12_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__13_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__14_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__15_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__16_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__17_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__18_.png?direct&600 |}} * **Bước 3:** Thêm hành động đặt nội dung văn bản, thiếp lập ghép 3 chuỗi * Ô chuỗi 1: chuyển đổi giá trị [ (thuộc tính HP hiện tại của người chơi) làm tròn xuống] thành chuỗi * Ô chuỗi 2: đặt dấu ngăn cách " / " * Ô chuỗi 3: chuyển đổi giá trị (thuộc tính HP hiện tại của người chơi) thành chuỗi {{ :developer_center:developer_editor:ui_health_bar__19_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__20_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__21_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__22_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__23_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__24_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__25_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__26_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__27_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__28_.png?direct&600 |}} ==== Hoàn Thành ==== {{ :developer_center:developer_editor:ui_health_bar__29_.png?direct&600 |}} * **Bước 4:** Thêm sự kiện thuộc tính HP của người chơi thay đổi sẽ kích hoạt mã HP {{ :developer_center:developer_editor:ui_health_bar__30_.png?direct&600 |}} {{ :developer_center:developer_editor:ui_health_bar__31_.png?direct&600 |}} * Với 1 số bản đồ có lưu tiến trình HP nên có thêm trigger sự kiện người chơi đăng nhập vào trò chơi sẽ tiến hành kích hoạt mã HP. Có thể thêm ngay vào trigger mở UI có sẵn {{ :developer_center:developer_editor:ui_health_bar__32_.png?direct&600 |}} ---- Nếu bạn có bất kỳ câu hỏi nào về Chế Độ DEV Nâng Cao, vui lòng tham gia\\ **[[https://www.facebook.com/groups/miniworldvn.developer|Mini World Developer Việt Nam]]** chính thức của chúng tôi