Surface

Surface functions that aid in minimizing boilerplate but maintaining high performance.

Functions

impulse.Surface.Close()

View source »

Plays a close sound

impulse.Surface.DefineTypeFace(fontFace, offsetx, offsety, alpha)

View source »

Defines a typeface's properties in handling text shadow.

Parameters

  • offsetx int default: 2

    The offset that the drop shadow will be.

  • offsety int default: 2

    The offset that the drop shadow will be.

  • alpha int default: 255

    The alpha of the shadow, recommended to keep at 255.

impulse.Surface.DrawArc(cx, cy, radius, thickness, startang, endang, roughness, color)

View source »

Draws an arc, no precaching required, lazy though.

Parameters

  • cx int

    The center x.

  • cy int

    The center y.

  • radius int

    The radius.

  • thickness int

    The thickness.

  • startang int

    The start angle.

  • endang int

    The end angle.

  • roughness int

    The roughness.

  • color color

    The color.

impulse.Surface.DrawPrecachedArc(arc)

View source »

Draws a precached arc.

Parameters

impulse.Surface.DrawText(text, font, x, y, color, alignX, alignY)

View source »

Draws text with a high quality shadow effect.

Parameters

  • x int

  • y int

  • color color

  • alignX int

  • alignY int

Returns

  • int

    The text width.

impulse.Surface.GetScreen()

View source »

Gets the current screen scale.

Returns

impulse.Surface.LongAffirm()

View source »

Plays a long affirm sound

impulse.Surface.Message(title, body, closeButtonText)

View source »

A better DermaMessage. Returned panel can access the close button with PANEL.mdCloseBtn.

Parameters

Returns

  • Panel

    The message panel.

impulse.Surface.PrecacheArc(cx, cy, radius, thickness, startang, endang, roughness)

View source »

Precaches an arc.

Parameters

  • cx int

    The center x.

  • cy int

    The center y.

  • radius int

    The radius.

  • thickness int

    The thickness.

  • startang int

    The start angle.

  • endang int

    The end angle.

  • roughness int

    The roughness.

impulse.Surface.Query(title, body, buttons)

View source »

A better DermaQuery. Unlike your standard DermaQuery, this Can handle as many buttons as you want, see QueryButton table for required fields.

Parameters

impulse.Surface.Rollover()

View source »

Plays a roll over sound

impulse.Surface.ScreenScale(low, mid, high)

View source »

Scales between the three values to the screenscale.

Parameters

  • low

  • mid

  • high

Returns

  • any

    The scaled value.

impulse.Surface.StringRequest(title, body, placeholder, submittext, callback, showclosebutton)

View source »

Allows the user to enter a string.

Parameters

  • callback function

  • showclosebutton boolean

Returns

  • Panel

    The message panel.

impulse.Surface.Submenu()

View source »

Plays a submenu sound

Tables

QueryButton

View source »

Fields for Derma_Query

Fields

  • text

  • onpress function

ScreenScale

View source »

Determines enumerations that aid in easily scaled UI

Fields

  • LowRes

  • FullRes

  • HighRes