ui.images: load all UI images as 2x for retina displays.
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 584 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 2.6 KiB |
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors assocs cache combinators images.loader kernel
|
||||
memoize namespaces opengl.textures sequences system
|
||||
math memoize namespaces opengl.textures sequences system
|
||||
ui.gadgets.worlds vocabs ;
|
||||
IN: ui.images
|
||||
|
||||
|
@ -9,7 +9,8 @@ TUPLE: image-name path ;
|
|||
|
||||
C: <image-name> image-name
|
||||
|
||||
MEMO: cached-image ( image-name -- image ) path>> load-image ;
|
||||
MEMO: cached-image ( image-name -- image )
|
||||
path>> load-image t >>2x? ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
|
@ -29,7 +30,7 @@ PRIVATE>
|
|||
rendered-image draw-scaled-texture ;
|
||||
|
||||
: image-dim ( image-name -- dim )
|
||||
cached-image dim>> ;
|
||||
cached-image dim>> [ 2 / ] map ;
|
||||
|
||||
{
|
||||
{ [ os macosx? ] [ "images.loader.cocoa" require ] }
|
||||
|
|