mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-05-12 08:00:12 +00:00
Page:
G2D.RotoZoom
Pages
Adding Support for a New Keyword
Console.Echo
Console.Log
Console.LogLevel
Dom.Add
Dom.Alert
Dom.Confirm
Dom.Container
Dom.Create
Dom.Event
Dom.Get
Dom.GetImage
Dom.Prompt
Dom.Remove
Export
FS.DownloadFile
FS.ListDirectory
FS.UploadFile
G2D.Bezier
G2D.Curve
G2D.Ellipse
G2D.FillCircle
G2D.FillEllipse
G2D.FillRoundRect
G2D.FillTriangle
G2D.InvertRect
G2D.LineCap
G2D.LineDash
G2D.LineDashOff
G2D.LineWidth
G2D.RotoZoom
G2D.RoundRect
G2D.SaveImage
G2D.Shadow
G2D.ShadowOff
G2D.Triangle
Home
Import
QBasic Language Support
Roadmap
Samples
Storage.Clear
Storage.Get
Storage.Key
Storage.Length
Storage.Remove
Storage.Set
Supported Keywords
Unsupported Keywords
3
G2D.RotoZoom
boxgaming edited this page 2023-05-12 11:50:59 -05:00
Table of Contents
Rotates and zooms an image.
Syntax
G2D.Rotate centerX&, centerY&, img&, [xScale%], [yScale%], [rotation%]
Parameters
- The centerX& and centerY& parameters indicate the location at which the center of the image will be rendered.
- The img& parameter is the id of the image to display.
- The optional xScale% parameter defines the horizontal scale applied to the image. If not specified, this will default to 1.0.
- The optional yScale% parameter defines the horizontal scale applied to the image. If not specified, this will default to 1.0.
- The optional rotation% parameter defines the rotation (in degrees) applied to the image. If not specified, this will default to 0.
Examples
Example1: Load an image and continuously rotate while alternating between zooming in and zooming out.
Import G2D From "lib/graphics/2d.bas"
Dim testImg As Long
testImage = _LoadImage("https://raw.githubusercontent.com/boxgaming/qbjs/main/logo.png")
Dim rot, zoom, zf
zf = .05
Do
Cls
G2D.RotoZoom 320, 200, testImage, zoom, zoom, rot
_Limit 60
rot = rot + 2
zoom = zoom + zf
If zoom >=8 Then zf = -.05
If zoom <=.5 Then zf = .05
If rot >= 360 Then rot = 0
Loop