mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Merge branch 'craftify' into 'master'
Move Craftify nametag up to not block the health bar. See merge request 2009scape/rt4-client!4
This commit is contained in:
commit
bc71be4b7f
1 changed files with 25 additions and 0 deletions
25
plugin-playground/src/main/kotlin/Craftify/plugin.kt
Normal file
25
plugin-playground/src/main/kotlin/Craftify/plugin.kt
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package Craftify
|
||||
|
||||
import plugin.Plugin
|
||||
import plugin.annotations.PluginMeta
|
||||
import plugin.api.API
|
||||
import plugin.api.FontColor
|
||||
import plugin.api.FontType
|
||||
import plugin.api.TextModifier
|
||||
import rt4.Fonts
|
||||
import rt4.Player
|
||||
import java.awt.Color
|
||||
|
||||
@PluginMeta(
|
||||
author = "bushtail",
|
||||
description = "Add nameplates above players heads.",
|
||||
version = 1.0
|
||||
)
|
||||
class plugin : Plugin() {
|
||||
override fun PlayerOverheadDraw(player: Player?, screenX: Int, screenY: Int) {
|
||||
if (player == null) return
|
||||
val width = Fonts.p11Full.getStringWidth(player.username)
|
||||
API.FillRect((screenX - width / 2) - 2, screenY - 20, width + 4, 14, FontColor.fromColor(Color.BLACK).colorCode, 125)
|
||||
API.DrawText(FontType.SMALL, FontColor.fromColor(Color.WHITE), TextModifier.CENTER, player.username.toString(), screenX, screenY - 8)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue