本文整理汇总了Golang中github.com/shibukawa/nanovgo.Context.Scale方法的典型用法代码示例。如果您正苦于以下问题:Golang Context.Scale方法的具体用法?Golang Context.Scale怎么用?Golang Context.Scale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/shibukawa/nanovgo.Context
的用法示例。
在下文中一共展示了Context.Scale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: RenderDemo
func RenderDemo(ctx *nanovgo.Context, mx, my, width, height, t float32, blowup bool, data *DemoData) {
drawEyes(ctx, width-250, 50, 150, 100, mx, my, t)
drawParagraph(ctx, width-450, 50, 150, 100, mx, my)
drawGraph(ctx, 0, height/2, width, height/2, t)
drawColorWheel(ctx, width-300, height-300, 250.0, 250.0, t)
// Line joints
drawLines(ctx, 120, height-50, 600, 50, t)
// Line widths
drawWidths(ctx, 10, 50, 30)
// Line caps
drawCaps(ctx, 10, 300, 30)
drawScissor(ctx, 50, height-80, t)
ctx.Save()
defer ctx.Restore()
if blowup {
ctx.Rotate(sinF(t*0.3) * 5.0 / 180.0 * nanovgo.PI)
ctx.Scale(2.0, 2.0)
}
// Widgets
drawWindow(ctx, "Widgets `n Stuff", 50, 50, 300, 400)
var x float32 = 60.0
var y float32 = 95.0
drawSearchBox(ctx, "Search", x, y, 280, 25)
y += 40
drawDropDown(ctx, "Effects", x, y, 280, 28)
popy := y + 14
y += 45
// Form
drawLabel(ctx, "Login", x, y, 280, 20)
y += 25
drawEditBox(ctx, "Email", x, y, 280, 28)
y += 35
drawEditBox(ctx, "Password", x, y, 280, 28)
y += 38
drawCheckBox(ctx, "Remember me", x, y, 140, 28)
drawButton(ctx, IconLOGIN, "Sign in", x+138, y, 140, 28, nanovgo.RGBA(0, 96, 128, 255))
y += 45
// Slider
drawLabel(ctx, "Diameter", x, y, 280, 20)
y += 25
drawEditBoxNum(ctx, "123.00", "px", x+180, y, 100, 28)
drawSlider(ctx, 0.4, x, y, 170, 28)
y += 55
drawButton(ctx, IconTRASH, "Delete", x, y, 160, 28, nanovgo.RGBA(128, 16, 8, 255))
drawButton(ctx, 0, "Cancel", x+170, y, 110, 28, nanovgo.RGBA(0, 0, 0, 0))
// Thumbnails box
drawThumbnails(ctx, 365, popy-30, 160, 300, data.Images, t)
}