From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113983 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alfredo Catalina via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Laundry symbols (now: altered picture) Date: Sun, 2 Jan 2022 18:10:55 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7839557976174165889==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6595"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alfredo Catalina , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 02 18:11:36 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n44OM-0001XJ-F1 for gctc-ntg-context-518@m.gmane-mx.org; Sun, 02 Jan 2022 18:11:34 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 145E3280211; Sun, 2 Jan 2022 18:11:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mx3FFQbZ1PrO; Sun, 2 Jan 2022 18:11:09 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1B920285891; Sun, 2 Jan 2022 18:11:09 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3B03F285891 for ; Sun, 2 Jan 2022 18:11:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WHQ4Qtgc7Uzw for ; Sun, 2 Jan 2022 18:11:07 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.46; helo=mail-ed1-f46.google.com; envelope-from=alfredo.catalina@gmail.com; receiver= Original-Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 06B40280211 for ; Sun, 2 Jan 2022 18:11:06 +0100 (CET) Original-Received: by mail-ed1-f46.google.com with SMTP id b13so127603227edd.8 for ; Sun, 02 Jan 2022 09:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=wjv7Z0V5otRHlyqi1DOPjsxE1reFiiRYswkdT5TOubk=; b=n55qCWY3AgzViNvuCT9e9SV/+O4Ikz7nFE15ega3w9yWLo1WRJoshoE+f0BWTmZ0h9 U+RdZl6HjcktF5aQgi+pW+OcJKKzmMC5cUPX97A30UHk2QqaOj1BWYbwpvcumy2QFGC6 /AB6mfCvg8TFNbAwEqmOQ5ZpEzLtu32euo+Ym9IihnGA2oSuubeTCy+J9Cka+V4FTyqV eINfIxZigZ/UpJvxkHPPsSULBGjnrH87RCvPUETUh8YApuY2dtBwlGYu370XKZjaMlFO x1kruX4bWs5Zlfxh8aW5Rs/UgMfv5YA8T7gwsnDwoiBpBpOuF4tYqfIJaGm84CAUav8W 4o3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=wjv7Z0V5otRHlyqi1DOPjsxE1reFiiRYswkdT5TOubk=; b=X91vauQH4fvEcN8utnGH9+F97tI2loZqajwWlmm9T0CU8jILvP/Pcau6uJ5G0EafNQ iwbbUDLGrOWBJ2GCaYHkkTwFE7q5LWi7byf9vUZWNv1YPaASHERtsj9jLqmN/U2ln6P/ z+PLmx7nU5dPs/aDwSLqK0s0YxOdrq9c81Ow6B+Oxtt1+C5+g+KegOGepYQYijv/bTOf tJV1BcOjZi48bgeuSOuaf/qT7qo0y+D9sHytCSVJPeXhwT+2ttFitcYd954uTAvsVGyd suGYp2bzZ1NqUZc6XTLaLS17Zbq2urG046hzSIkNbHvSGv3dqcTRYDCrmq7NpWri5IZD kgkQ== X-Gm-Message-State: AOAM532MCwvjFzSxAEpNbE81zQI/PV84fqpXdop9BmXmRwXoVipOWSDH GCy1zq6amX5QRqOMKeVsqBqOYW7Aq18nRBjOxccp8g3mHS0= X-Google-Smtp-Source: ABdhPJwPg0HBpOp7rQIJaKajDsESMo5gG+ue/HPPH91Fy4oRrHlok0P/9fcDPL+c5vm2h0rR1PWzfb1tDzRbYQpwlok= X-Received: by 2002:a05:6402:148:: with SMTP id s8mr41668292edu.221.1641143466357; Sun, 02 Jan 2022 09:11:06 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:113983 Archived-At: --===============7839557976174165889== Content-Type: multipart/alternative; boundary="0000000000005677aa05d49c7d23" --0000000000005677aa05d49c7d23 Content-Type: text/plain; charset="UTF-8" Great! Thanks Hans, now it works. I replaced the "draw externalfigure" commands by draw externalfigure "./skysprite.png" xsized 4u ysized 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xsized 4u ysized 5u shifted (0u,-5u); Best regards On Sun, Jan 2, 2022 at 3:36 PM Hans Hagen wrote: > On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wrote: > > I'm trying to use ConTeXt with Metafun to produce a map of a videogame I > > am working on. In fact I did it 9 years ago but it seems that now it > > doesn't work. > > > > I have two 32 pixels wide by 40 pixels high sprites. They are saved in > > the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 > > x 8, the width/height ratio is 4/5. > > > > This should produce a page with a sky sprite and a sand sprite, one > > below the other. It worked in the past. Each sprite should be 4 x 0.095 > > cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: > > > > \starttext > > \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] > > \startuseMPgraphic{mapa} > > u:=.095cm; > > draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted > > (0u,-0u); > > draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted > > (0u,-5u); > > \stopuseMPgraphic > > \useMPgraphic{mapa} > > \stoptext > > > > But instead I got two huge sprites of 2.8 cm x 4.4 cm. > > > > Am I forgetting something? > Originally that worked because the image was always 'included' at 1 bp > and then scaled but that was (1) inaccurate and (2) a bit depending on > the image and (3) could overflow metapost. > > Use xsized and ysized instead (absolute measures instead of scaling the > unknown) > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > --0000000000005677aa05d49c7d23 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Great! Thanks Hans, now it works. I replaced the &quo= t;draw externalfigure" commands by

draw exter= nalfigure "./skysprite.png" xsized 4u ysized 5u shifted (0u,-0u);=
draw externalfigure "./sandsprite.png" xsized 4u y= sized 5u shifted (0u,-5u);

Best regards
<= br>
On Sun,= Jan 2, 2022 at 3:36 PM Hans Hagen <j.hagen@xs4all.nl> wrote:
On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wro= te:
> I'm trying to use ConTeXt with Metafun to produce a map of a video= game=C2=A0I
> am=C2=A0working=C2=A0on. In fact I did it 9 years ago but it seems tha= t now it
> doesn't work.
>
> I have two 32 pixels wide by 40 pixels high sprites. They are saved in=
> the skysprite.png and sandsprite.png files. Since 32 =3D 4 x 8 and 40 = =3D 5
> x 8, the width/height ratio is 4/5.
>
> This should produce a page with a sky sprite and a sand sprite, one > below=C2=A0the other. It worked in the past. Each sprite should be 4 x= 0.095
> cm =3D 0,38 cm wide and 5 x 0.095 cm =3D 0.475 cm high:
>
> \starttext
> \setupMPinstance[metafun][textstyle=3D{\switchtobodyfont[termes,8pt]}]=
> \startuseMPgraphic{mapa}
> u:=3D.095cm;
> draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u = shifted
> (0u,-0u);
> draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u= shifted
> (0u,-5u);
> \stopuseMPgraphic
> \useMPgraphic{mapa}
> \stoptext
>
> But instead I got two huge sprites of 2.8 cm x 4.4 cm.
>
> Am I forgetting something?
Originally that worked because the image was always 'included' at 1= bp
and then scaled but that was (1) inaccurate and (2) a bit depending on
the image and (3) could overflow metapost.

Use xsized and ysized instead (absolute measures instead of scaling the unknown)

Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.nl | www.= pragma-pod.nl
-----------------------------------------------------------------
--0000000000005677aa05d49c7d23-- --===============7839557976174165889== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============7839557976174165889==--