Open kylpo opened 6 years ago
The Container widget lets you create a rectangular visual element. A container can be decorated with a BoxDecoration, such as a background, a border, or a shadow. A Container can also have margins, padding, and constraints applied to its size. In addition, a Container can be transformed in three dimensional space using a matrix.
Had no idea that primitives like <input>
were using shadow-dom before shadow-dom was a thing. <input type="range">
is just a wrapper of multiple div
s in a shadow-root.
https://bitsofco.de/what-is-the-shadow-dom/
So, really, button
, input
, are maybe not the base level of primitives. They can be considered a composite component. Maybe a "primitive" composite component?
On that thought, link
really is just interactable text
with state for if it has been visited or not.
Layout. E.g. Column and Row widgets which make it easy for us to align other widgets vertically or horizontally to each other. Painting. E.g. Text and Image widgets allow us to display (‘paint’) some content onto the screen. Hit-Testing. E.g. the GestureDetector allows us to recognise different gestures such as tapping (for detecting the press of a button) and dragging (for swiping through a list).
Template
Setting
Structure -the arrangement of and relations between the parts or elements of something complex.
Arrangement
Compositor
Composition
Configuration (configurator, configurational)
Choreography (choreographer)
There are several kinds of events, including touch events, motion events, remote-control events, and press events.
UIView: Drawing and animation
Layout and subview management
Event handling
layout, bounds, constraints, collision/hit detection of a rectangle-based layout when it is a circle or triangle?
Hit testing of drawings. Chapter 18. Touches
SpriteKit has a lot of affordances that specifically make creating games easier, such as the particle systems, physics system, collision callbacks, scene editor, gameplay loop, GameplayKit integration, etc.
There are some things it doesn't do really well, such as text rendering or displaying web content or laying out tabular data, so the UIKit animation stuff might be good for that narrow category of games which don't fall far from the typical UIKit conventions - A Dark Room would be an example - but for most traditional 2D games, SpriteKit will probably be a better choice.
Keep in mind that you can mix and match. You can have the main menu as a standard UIKit screen, and then the main gameplay driven by a SpriteKit scene in a SpriteKit view. So depending on the structure of your app, you can perhaps take advantage of the strengths of both approaches. reddit: the front page of the internet
There is nothing you can do about that if you're going to use simple-minded collisions (e.g. the built-in UIKit Dynamics - it does only rectangular view collisions). If you want advanced shape collisions, either you must implement them yourself or you must use Sprites. ios - Triangle UIView - Swift - Stack Overflow
Content objects as just containers of paint/pixels, lines, etc. 2d coordinate system. Bounded and described as a rectangle.
Triangle in UIKit:
context.beginPath()
context.move(to: CGPoint(x: rect.minX + _margin, y: rect.maxY - _margin))
context.addLine(to: CGPoint(x: rect.maxX - _margin, y: rect.maxY - _margin))
context.addLine(to: CGPoint(x: (rect.maxX / 2.0), y: rect.minY + _margin))
context.closePath()
context.setFillColor(_color.cgColor)
context.fillPath()
an image is paint (pixels), a line, a box, text is paint.
"View" is just something in a box (rectangular coordinates) that can be interacted with. This is why you can onClick any web element.
smallest unit is a static pixel. But this isn't too helpful for a developer, so we instead are given lines, shapes, etc. Still only good for non-interactive content. So, we are given a higher abstraction: the View.
Layout: question is what to do on overflow: wrap, scroll, cut off, zoom out, etc
UIView takes care of many things including layout or handling touch events. It’s interesting to notice that it doesn’t directly take care of the drawing or animations, UIKit delegates that task to its brother: CoreAnimation.
CALayer Tutorial for iOS: Getting Started | raywenderlich.com
OR Paint, Layout, and Events (user generated and system generated)
Primitives made up of content, structure, and interaction components.
Content: text is content, img is content.
divs are not
Structure: divs
Interaction: button, input, link