Quark
#
Modules #
quark/action
quark/app
quark/bubbles
quark/buffer
quark/checkbox
quark/css
quark/ctr
quark/dialog
quark/event
quark/font
quark/fs
quark/http
quark/index
quark/keyboard
quark/media
quark/nav
quark/os
quark/path
quark/pkg
quark/screen
quark/stepper
quark/storage
quark/test
quark/types
quark/util
quark/view
quark/window
quark/_common
quark/_event
quark/_ext
quark/_util
Quark v1.2.0 Documentation
Table of Contents
-
quark/window
- Interface: Options
-
Class: NativeWindow
- NativeWindow
- nativewindow.scale
- nativewindow.defaultScale
- nativewindow.fsp
- nativewindow.atomPixel
- nativewindow.root
- nativewindow.focusView
- nativewindow.navigationRect
- nativewindow.size
- nativewindow.backgroundColor
- nativewindow.surfaceSize
- nativewindow.nextFrame(cb)
- nativewindow.activate()
- nativewindow.close()
- nativewindow.pending()
- nativewindow.setFullscreen(fullscreen)
- nativewindow.setCursorStyle(style)
- nativewindow.constructor(opts?)
- Class: Window
quark/window #
Interface: Options #
Options #
options.olorType? #
init window color type
olorType?
:Uint
options.msaa? #
init window gpu render msaa count
msaa?
:Uint
options.frame? #
init window params
frame?
:types.Rect
options.title? #
init window title
title?
:string
options.backgroundColor? #
init window background color
backgroundColor?
:types.Color
options.navigationColor? #
Is need draw navigation buttons for android.
navigationColor?
:types.Color
Class: NativeWindow #
NativeWindow #
@extends
Notification
nativewindow.scale #
The scaling ratio of the physical pixel size of the window to the drawing size
@get
scale
:number
nativewindow.defaultScale #
The default recommended scaling ratio between window physical pixels and drawing size
@get
defaultScale
:number
nativewindow.fsp #
Current drawing frame rate
@get
fsp
:Uint
nativewindow.atomPixel #
Atom pixel size, Exp: 1 / scale
@get
atomPixel
:number
nativewindow.root #
The only root view in the window
@get
root
:Root
nativewindow.focusView #
Current focus view
@get
focusView
:View
nativewindow.navigationRect #
Navigation rect, possibly in the Android bottom navigation button area
@get
navigationRect
:types.Rect
nativewindow.size #
- Set the logical size of the window. When this value changes, the change event will be triggered.
- When both width and height are set to zero, the most comfortable default display size is automatically set.
- If the width is set to non-zero, it means the width is fixed, and the height is automatically set according to the window ratio.
- If the height is set to non-zero, it means the height is fixed, and the width is automatically set according to the window ratio.
size
:types.Vec2
nativewindow.backgroundColor #
The background color for the window
backgroundColor
:types.Color
nativewindow.surfaceSize #
Window physical surface pixel size
surfaceSize
:types.Vec2
nativewindow.nextFrame(cb) #
When rendering next frame call
nativewindow.activate() #
Activate the display window or taking the window to the foreground
@return
this
nativewindow.close() #
To close or destroy the window
@return
void
nativewindow.pending() #
Taking window to background and pending
@return
void
nativewindow.setFullscreen(fullscreen) #
Setting whether the window is displayed in full screen mode
nativewindow.setCursorStyle(style) #
Setting the mouse cursor style
@param
style
:types.CursorStyle
@return
void
nativewindow.constructor(opts?) #
@param
opts?
:Options
Class: Window #
Window #
@extends
NativeWindow
window.rootCtr #
The only root view controller in the window
@get
rootCtr
:ViewController
window.render(vdom) #
Create a view or view controller DOM
by vdom
@return
DOM
Example:
import {Application,Window,ViewController} from 'quark'
import * as http from 'quark/http'
import * as buffer from 'quark/buffer'
class MyCtr extends ViewController<{param: number}, {data?: Uint8Array}> {
triggerLoad() {
return http
.get('[`http://192.168.1.100:1026/README.md?param='`](http://192.168.1.100:1026/README.md?param=') + this.props.param)
.then(e=>this.setState({data:e.data}));
}
render() {
return (
<box width={100} height={100} backgroundColor="#f00">
{this.state.data&&buffer.toString(this.state.data)}
</box>
)
}
}
new Application();
new Window().activate().render(
<MyCtr param={10} />
);
@param
vdom
:VirtualDOM