Minescript HUD 附加组件
此模组允许在 Minescript 中绘制自定义 HUD 元素。
对于在世界中渲染对象的功能,我将制作一个单独的模组。
文档可在 wiki 中找到。
错误/功能
如果您有任何建议或发现了任何错误,请填写此 Google 表单。
目前正在开发世界内绘图功能。
功能
- 在 HUD 上绘制 文本
- 绘制 矩形 和渐变矩形
- 渲染 物品
- 渲染 纹理
- 渲染 自定义形状
- 动画化 所有元素属性
- 检测 鼠标悬停和点击事件
- 控制 显示持续时间 和 渲染层级
安装
- 安装 Minescript。
- 将此附加组件放入您的
mods文件夹中。 - 启动游戏。
示例
from hud_renderer import *
add_text("Hello World",x=10,y=10,color=argb(255,255,255,255),shadow=True,display_duration=5)
动画
所有 HUD 元素都可以使用动画函数进行动画化。
from hud_renderer import *
def move(text:TextObject):
text.x+=1
_id=add_text("I can MOVE!",x=10,y=10,color=Colors.WHITE,shadow=True,display_duration=5)
animate_text(_id,move)
鼠标事件
所有对象都可以检测鼠标悬停和点击事件。
from minescript import echo
from hud_renderer import *
def hover(text:TextObject,mouse:MouseObject,exited:bool):
if (exited):
text.color=Colors.WHITE
else:
text.color=Colors.GREEN
def click(text:TextObject,mouse:MouseObject):
echo("Clicked!")
_id=add_text("Click me!",x=10,y=10,color=Colors.WHITE,shadow=True,display_duration=10)
add_mouse_callbacks_and_wait(_id,on_hover=hover,on_click=click)
层级系统
元素按层级渲染。
具有较高层级值的元素会渲染在具有较低层级值的元素之上。
API 概览
更详细的 API 可在 wiki 中找到。
文本
add_text(...)add_text_with_background(...)add_advanced_text(...)add_advanced_text_with_background(...)animate_text(...)animate_text_with_background(...)
矩形
add_rectangle(...)add_rectangle_from_corners(...)add_gradient_rectangle(...)add_stroked_rectangle(...)animate_rectangle(...)
物品
add_item(...)add_advanced_item(...)animate_item(...)
纹理
注意: 自定义纹理必须通过资源包添加到
assets/minescripthud/textures/gui/sprites/文件夹中。
add_texture(...)add_advanced_texture(...)animate_texture(...)
形状
add_shape(...)add_advanced_shape(...)animate_shape(...)add_line(...)add_multiline(...)add_triangle(...)add_quad(...)add_circle(...)add_ellipse(...)
抗锯齿形状(边缘平滑)
add_anti_aliased_shape(...)add_advanced_anti_aliased_shape(...)animate_anti_aliased_shape(...)add_line_with_thickness(...)add_anti_aliased_quad(...)add_anti_aliased_rectangle(...)add_anti_aliased_rectangle_with_round_corners(...)get_points_for_circle(...)add_anti_aliased_circle(...)get_points_for_ellipse(...)add_anti_aliased_ellipse(...)
实用函数
argb(...)argb_to_int(...)alpha_from_int(...)add_async_mouse_callbacks(...)add_mouse_callbacks_and_wait(...)wait_until_removed(...)remove_element(...)clear()suppress_done_message()
Minescript HUD Addon
This mod adds the ability to draw custom HUD elements in Minescript.
For rendering objects in the world, I will be making a seperate mod.
Documentation can be found in the wiki.
Bugs/Features
If you have any suggestions, or found any bugs, please fill out this google form.
currently working on adding in world drawing.
Features
- Draw text on the HUD
- Draw rectangles and gradient rectangles
- Render items
- Render textures
- Render custom shapes
- Animate all element properties
- Detect mouse hover and click events
- Control display duration and render layers
Installation
- Install Minescript.
- Place this addon in your
modsfolder. - Launch the game.
Example
from hud_renderer import *
add_text("Hello World",x=10,y=10,color=argb(255,255,255,255),shadow=True,display_duration=5)
Animations
All HUD elements can be animated using animation functions.
from hud_renderer import *
def move(text:TextObject):
text.x+=1
_id=add_text("I can MOVE!",x=10,y=10,color=Colors.WHITE,shadow=True,display_duration=5)
animate_text(_id,move)
Mouse Events
All objects can detect mouse hover and click events.
from minescript import echo
from hud_renderer import *
def hover(text:TextObject,mouse:MouseObject,exited:bool):
if (exited):
text.color=Colors.WHITE
else:
text.color=Colors.GREEN
def click(text:TextObject,mouse:MouseObject):
echo("Clicked!")
_id=add_text("Click me!",x=10,y=10,color=Colors.WHITE,shadow=True,display_duration=10)
add_mouse_callbacks_and_wait(_id,on_hover=hover,on_click=click)
Layer System
Elements are rendered in layers.
Elements with higher layer values render above elements with lower layers.
API Overview
A more detailed API can be found on the wiki.
Text
add_text(...)add_text_with_background(...)add_advanced_text(...)add_advanced_text_with_background(...)animate_text(...)animate_text_with_background(...)
Rectangles
add_rectangle(...)add_rectangle_from_corners(...)add_gradient_rectangle(...)add_stroked_rectangle(...)animate_rectangle(...)
Items
add_item(...)add_advanced_item(...)animate_item(...)
Textures
Note: Custom textures must be added by a resource pack in the
assets/minescripthud/textures/gui/sprites/folder.
add_texture(...)add_advanced_texture(...)animate_texture(...)
Shapes
add_shape(...)add_advanced_shape(...)animate_shape(...)add_line(...)add_multiline(...)add_triangle(...)add_quad(...)add_circle(...)add_ellipse(...)
Anti-Aliased Shapes (with smooth edges)
add_anti_aliased_shape(...)add_advanced_anti_aliased_shape(...)animate_anti_aliased_shape(...)add_line_with_thickness(...)add_anti_aliased_quad(...)add_anti_aliased_rectangle(...)add_anti_aliased_rectangle_with_round_corners(...)get_points_for_circle(...)add_anti_aliased_circle(...)get_points_for_ellipse(...)add_anti_aliased_ellipse(...)
Utility functions
argb(...)argb_to_int(...)alpha_from_int(...)add_async_mouse_callbacks(...)add_mouse_callbacks_and_wait(...)wait_until_removed(...)remove_element(...)clear()suppress_done_message()
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
下载 Minescript HUD Addon
元素
新增了一种抗锯齿形状(边缘平滑)。
函数
新增 11 个函数:
add_anti_aliased_shapeadd_advanced_anti_aliased_shapeanimate_anti_aliased_shapeadd_line_with_thicknessadd_anti_aliased_quadadd_anti_aliased_rectangleadd_anti_aliased_rectangle_with_round_cornersget_points_for_circleadd_anti_aliased_circleget_points_for_ellipseadd_anti_aliased_ellipse
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧