#setImage
Explore tagged Tumblr posts
Note
Great, here are 3 more links lol
http://imagn.com/setImages/588050/preview/23258707
http://imagn.com/setImages/588050/preview/23258704
http://imagn.com/setImages/588050/preview/23258702
i think i speak for everyone when i say we love you



14 notes
·
View notes
Video
youtube
Swift: Create Facebook (Part 2) - UICollectionView, NSLayoutConstraint
my review point is 8/10
https://youtu.be/ZwBYQpLQAvw?t=8m15s button style ( setTitle, setTitleColor , setImage , titleEdgeInsets)
https://youtu.be/ZwBYQpLQAvw?t=14m35s equally spaced out elements
https://youtu.be/ZwBYQpLQAvw?t=18m37s refresh collection view when user change orientation ( viewWillTransitionToSize , invalidateLayout)
#ios#brian#facebook feed#facebook#setTitle#setTitleColor#button#setImage#titleEdgeInsets#insets#inset#equal#equally#viewWillTransitionToSize#orientation#invalidateLayout#NSLayoutConstraint#UICollectionView
0 notes
Photo
Deconstructing the Iconography of Set
21 notes
·
View notes
Text
HackingWithSwift Day 19/20/21
Project 2
var countries = [String]()
countries.append("estonia") countries.append("france") countries.append("germany")
countries += ["estonia", "france", "germany",]
Two ways to append array =======================
func askQuestion(action: UIAlertAction! = nil) { button1.setImage(UIImage(named: countries[0]), for: .normal) button2.setImage(UIImage(named: countries[1]), for: .normal) button3.setImage(UIImage(named: countries[2]), for: .normal) }
If assign a default value to a passing param for a function, when call the function, can just write askQuestion() without pass in anything. Looks confusing but better try to get use to it
============================
Just realized I can’t do ++ , but only += 1 when I try to do the challenge
For this project, not much note as per project 1 as well, since most of them I learned before when I use objective-c
0 notes
Text
Mets 2018 Photo Day Pic Sources!
...that I know of. Know any others? lmk and I’ll add to the list that way everyone has access to all players and content and won’t solely be restricted to what’s been posted so far. Someone might stan for Jacob Rhame. You never know.
http://www.zimbio.com/pictures/Wld8L0EZXgs/New+York+Mets+Photo+Day/Irqrme3U_T-
https://www.newsday.com/sports/baseball/mets/mets-photo-day-2018-1.16901672
https://www.usatsimg.com/setImages/215151
http://www.nj.com/mets/index.ssf/2018/02/meet_the_mets_20_pictures_from_mets_2018_photo_day.html
5 notes
·
View notes
Text
//server icon
const Discord = require('discord.js');
exports.run = function(client, message) {
const embed = new Discord.RichEmbed()
.setImage(message.guild.iconURL)
.setFooter('OK-Bots')
message.channel.send(embed);
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 0
};
exports.help = {
name: 'servericon',
description: 'Serverin iconunu gösterir',
usage: 'servericon'
};
//discord invite link: http://gg.gg/OnlineKingdomD_NO3
0 notes
Text
Sample Code - Add a Image on Google Map
Add a Image on Google Map using Overlay
Integration of Google Map with location applications provides a better navigation for user. You can add custom images , text and view on the Map View using the Overlay class provided by Google APIs. See the previous post to integrate the location listener with your basic google map view. http://creativeandroidapps.blogspot.in/2012/07/sample-code-update-google-map-using.html This post will focus on adding a image on the map view on the detected location by the location listener. You can use the Overlay class from com.google.android.maps package. Now create a new class "GLocate.java" in your sample application which is extending the com.google.android.maps.Overlay class. See the code as follows package com.example.gmapsample; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Point; import android.location.Location; import android.util.Log; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapView; public class GLocate extends com.google.android.maps.Overlay{ GeoPoint location = null; Bitmap overlay_img = null; public GLocate(GeoPoint location) { super(); this.location = location; } public void setImage(Bitmap bmp) { this.overlay_img = bmp; } @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { super.draw(canvas, mapView, shadow); //translate the screen pixels Paint p = new Paint(); Point screenPoint = new Point(); mapView.getProjection().toPixels(this.location, screenPoint); Log.i("GLocate","draw : x = "+ screenPoint.x + "y= " + screenPoint.y); //add the image canvas.drawBitmap(overlay_img,screenPoint.x, screenPoint.y , p); //Setting the image location on the screen (x,y). mapView.invalidate(); //redraw the map view } } Now integrate the class in your main activity code as follows (see the highlighted lines of code)
0 notes
Note
I hope this link works, this is the pic I saw
http://imagn.com/setImages/588050/preview/23258495

crispyyyyy 🤤
4 notes
·
View notes
Photo
Deconstructing the Iconography of Set
The smaller Dakhla stela shows a hawk-headed Seth with a sun disk on his head with the epithet of ‘Sutekh great of strength’ (Fig. 8.18)
10 notes
·
View notes
Link
Let's say a user of your site wants to edit a list item without opening the item and looking for editing options. If you can enable this functionality, it gives that user a good User Experience. Pocket, a bookmarking app owned by Mozilla, does something similar. You can share/archive/delete your saved articles directly from the list without opening the article. Then you can click the menu button in the top-right corner and select your edit option. So in this tutorial we'll try to code this one out. Here's what we want to achieve:
First let’s create a normal RecyclerView list
RecyclerView is an advanced and flexible version of ListView and GridView. It's capable of holding large amounts of list data and has better performance than its predecessors. As the name suggests, RecyclerView 'recycles' the items of our list once it's out of view on scrolling and re-populates them when they come back to view. So the list container has to maintain only a limited number of views and not the entire list. It's so flexible that the new ViewPager2 class, used to create swipe-able tabs, is written over RecyclerView.
Create a POJO (Plain Old Java Object) to hold the list data
public class RecyclerEntity { private String title; private boolean showMenu = false; private int image; public RecyclerEntity() { } public RecyclerEntity(String title, int image, boolean showMenu) { this.title = title; this.showMenu = showMenu; this.image = image; } public int getImage() { return image; } public void setImage(int image) { this.image = image; } //... all the getters and setters }
Notice we have a showMenu member here which will handle the visibility of the menu for that list item in our RecyclerView.
Create a RecyclerView Adapter
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { List<RecyclerEntity> list; Context context; public RecyclerAdapter(Context context, List<RecyclerEntity> articlesList) { this.list = articlesList; this.context = context; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v; v= LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_list, parent, false); return new MyViewHolder(v); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { RecyclerEntity entity = list.get(position); if(holder instanceof MyViewHolder){ ((MyViewHolder)holder).title.setText(entity.getTitle()); ((MyViewHolder)holder).imageView.setImageDrawable(context.getResources().getDrawable(entity.getImage())); } } @Override public int getItemCount() { return list.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { TextView title; ImageView imageView; ConstraintLayout container; public MyViewHolder(View itemView) { super(itemView); title = itemView.findViewById(R.id.title); imageView = itemView.findViewById(R.id.imageView); container = itemView.findViewById(R.id.container); } } }
Usually we put our ViewHolder sub class (MyViewHolder) in the super class template. This lets us directly return our defined ViewHolder subclass object from the onCreateViewHolder() method. Then we don't have to cast it again and again in onBindViewHolder() method. But here we can't do that, and we'll learn why in a minute.
Initialise the RecyclerView in the Activity
public class MainActivity extends AppCompatActivity { RecyclerView recyclerView; List<RecyclerEntity> list; RecyclerAdapter adapter; @RequiresApi(api = Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = findViewById(R.id.recyclerview); list = new ArrayList<>(); list.add(new RecyclerEntity("This is the best title", R.drawable.one, false)); list.add(new RecyclerEntity("This is the second-best title", R.drawable.two, false)); //... rest of the list items adapter = new RecyclerAdapter(this, list); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter); } }
Now let's start making things a little more interesting.
Create a layout resource for the menu
And initialise it in Recycler Adapter:
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { List<RecyclerEntity> list; Context context; private final int SHOW_MENU = 1; private final int HIDE_MENU = 2; public RecyclerAdapter(Context context, List<RecyclerEntity> articlesList) { this.list = articlesList; this.context = context; } @Override public int getItemViewType(int position) { if(list.get(position).isShowMenu()){ return SHOW_MENU; }else{ return HIDE_MENU; } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v; if(viewType==SHOW_MENU){ v= LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_menu, parent, false); return new MenuViewHolder(v); }else{ v= LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_list, parent, false); return new MyViewHolder(v); } } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { RecyclerEntity entity = list.get(position); if(holder instanceof MyViewHolder){ //... same as above } if(holder instanceof MenuViewHolder){ //Menu Actions } } @Override public int getItemCount() { return list.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { //... same as above } //Our menu view public class MenuViewHolder extends RecyclerView.ViewHolder{ public MenuViewHolder(View view){ super(view); } } }
Now we have two ViewHolder sub-classes in our adapter, MyViewHolder (the actual list item) and MenuViewHolder. Both inherit the same class so we return the parent class RecyclerView.ViewHolder from onCreateViewHolder(). Our getItemViewType() method returns the int variable (viewType) which tells the kind of view we want to show in our RecyclerView for a particular position: that is, either MyViewHolder or MenuViewHolder. This viewType variable is then used by onCreateViewHolder() which actually returns the respective ViewHolder object.
Add the functions to show/hide menu in RecyclerAdapter
public void showMenu(int position) { for(int i=0; i<list.size(); i++){ list.get(i).setShowMenu(false); } list.get(position).setShowMenu(true); notifyDataSetChanged(); } public boolean isMenuShown() { for(int i=0; i<list.size(); i++){ if(list.get(i).isShowMenu()){ return true; } } return false; } public void closeMenu() { for(int i=0; i<list.size(); i++){ list.get(i).setShowMenu(false); } notifyDataSetChanged(); }
Note that there are many ways to handle this. But for simplicity's sake we're keeping a boolean value in our POJO to maintain the menu's visibility. After changing our data list, we call the notifyDataSetChanged() method to redraw the list.
Show the menu on long press of our list item in RecyclerAdapter
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { RecyclerEntity entity = list.get(position); if(holder instanceof MyViewHolder){ ((MyViewHolder)holder).title.setText(entity.getTitle()); ((MyViewHolder)holder).imageView.setImageDrawable(context.getResources().getDrawable(entity.getImage())); ((MyViewHolder)holder).container.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { showMenu(position); return true; } }); } if(holder instanceof MenuViewHolder){ //Set Menu Actions like: //((MenuViewHolder)holder).edit.setOnClickListener(null); } }
Again, setting events on our views can also be done in various ways. In our example, we have three actions in our menu. You can write your logic to handle those actions in the second if statement like shown in the comments.
Show the menu on swipe
To do this, we add a touch helper in our MainActivity.java:
public class MainActivity extends AppCompatActivity { RecyclerView recyclerView; List<RecyclerEntity> list; RecyclerAdapter adapter; @RequiresApi(api = Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState) { //... same as above adapter = new RecyclerAdapter(this, list); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter); ItemTouchHelper.SimpleCallback touchHelperCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { private final ColorDrawable background = new ColorDrawable(getResources().getColor(R.color.background)); @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { return false; } @Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { adapter.showMenu(viewHolder.getAdapterPosition()); } @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); View itemView = viewHolder.itemView; if (dX > 0) { background.setBounds(itemView.getLeft(), itemView.getTop(), itemView.getLeft() + ((int) dX), itemView.getBottom()); } else if (dX < 0) { background.setBounds(itemView.getRight() + ((int) dX), itemView.getTop(), itemView.getRight(), itemView.getBottom()); } else { background.setBounds(0, 0, 0, 0); } background.draw(c); } }; ItemTouchHelper itemTouchHelper = new ItemTouchHelper(touchHelperCallback); itemTouchHelper.attachToRecyclerView(recyclerView); }
We call the showMenu() function inside our adapter when a list item is swiped. The onChildDraw() function draws the background while we swipe. Otherwise there'll be a white background while swiping and our menu layout will show up with a pop.
Hiding the menu
There are three ways to hide our menu.
Hiding the menu when another row is swiped:
This case is already handled in showMenu() method in our Adapter. Before showing the menu for any row, we first call setShowMenu(false) for all the rows to hide the menu. 2. Hiding the menu when the back button is pressed (in our Activity):
@Override public void onBackPressed() { if (adapter.isMenuShown()) { adapter.closeMenu(); } else { super.onBackPressed(); } }
3. Hiding the menu when a user scrolls the list:
recyclerView.setOnScrollChangeListener(new View.OnScrollChangeListener() { @Override public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { adapter.closeMenu(); } });
Though pocket only has a long-press action to show the menu, in this example we've added swipe to show the menu for added functionality. You can hide your menu item on swipe right/left again, but I think it might confuse the user.
Wrapping up
If your app has a very large dataset to show in a RecyclerView, this type of UX might not be the way to go. In that case you should have a bulk-edit sort of functionality. Also if your edit options are more than what you can adjust in a RecyclerView row but you still want to show some quick actions, you can show a Bottomsheet dialog on long press of your item and it can have all your edit options. The Google Drive android app does exactly the same thing.
0 notes
Text
GREENFOOT DOWNLOADEN
Wenn Sie eine Zahl zwischen 5 und 9 wollen, schreiben Sie also Greenfoot. Kein Teil des Greenfoot-Systems oder seiner Dokumentation darf einzeln oder in Verbindung mit anderen Dingen verkauft werden. Stoppen Sie die Animation, falls sie noch läuft. Tutorien [4] und Instruktionsvideos [5] zur Verfügung. Navigation Hauptseite Themenportale Zufälliger Artikel.
Name: greenfoot Format: ZIP-Archiv Betriebssysteme: Windows, Mac, Android, iOS Lizenz: Nur zur personlichen verwendung Größe: 25.11 MBytes
Tagung Lehrkräftegesundheit 3. Grundlagen – Übersicht 1: Es sind drei verschiedene Versionen des Systems verfügbar: Rufen Sie eine Methode auf. Falls nicht, bitte erst die Java-Umgebung nach Anleitung korrekt installieren. Sie liegen somit übereinander. Dieser Teil ist nicht gedacht für die Bearbeitung durch Personen, die erst mit der Programmierung beginnen oder Java noch nicht greefoot.
Copyright, Lizenz und Weitergabe.
youtube
Falls diese Liste leer ist, können wir vorwärts gehen, sonst können wir es nicht. Die Installation folgt der Standardvorlage für Programminstallationen auf Windows.
Mehrere Levels in Greenfoot 3 / Level wechseln
Das Problem liegt ja darin, dass bei der Erzeugung eines neuen Levels mit z. Und wir gehen davon aus, dass die Steine so gross sind, dass die Wombats sie nicht überwinden können, sondern um sie herum laufen müssen Wenn Sie also ein Attribut vom Datentyp int haben z. Benötigte Software HA auf Textausgabe in Konsole Möglichkeit 1 – Einfachste Lösung: Es gibt zwei Versionen der Methode ’setImage‘: Damit kennt im Beispiel Level2 den aktuellen Punktestand, der Punktestand bleibt beim Levelwechsel erhalten.
Zähler für Punkte, Kollisionen etc.
Greenfoot Tutorial – German Translation
Dieses ist sehr hilfreich, wenn man Klassen während ihrer Entwicklung testen möchte. Dann wird das Auto auf die Grsenfootgesetzt. Fügen Sie die folgende Methode zur Wombat-Klasse hinzu. Schullaufbahn und weiterer Bildungsweg Qualitätsmerkmal 6. Wenn wir also schreiben:.
Was passiert nach der Visitation? Neue Klasse anlegen 4: Wenn Sie hreenfoot Objekt an eine zufällige Position setzen wollen, dann schreiben Sie: Wenn Sie verstehen möchten, wie das funktioniert, schauen Sie hier: Einstellungen; neues Szenario 2: Wir verwenden immer this, wenn wir anzeigen wollen, dass wir uns auf das aktuelle Objekt beziehen, also. Einfache Spiele sind selbst für Anfänger nach freenfoot Zeit erreichbar, was oft zu guter Motivation führt.
So sieht nun also die neue, verbesserte Version der Methode ’setDirection‘ aus: Nun probieren wir hreenfoot greenfooot. Die Software für das Greenfoot-System kann von www.
Wir haben eben gesehen, dass die Objekte in der Welt eigene Methoden besitzen, welche über das jeweilige Kontextmenü aufgerufen werden können. Da der act -Zyklus bei Standard-Geschwindigkeitseinstellung mehrere Male pro Sekunde durchlaufen wird, erhalten wir mit einem einzigen kurzen Tastendruck gleich mehrere Geschosse. Grundlagen Übersicht letzte Grreenfoot an dieser Seite: Vorbereitungen Es muss mindestens Java in der Version 5 d.
Greenfoot_GerAPI_
Eine Dialogbox erscheint und man grreenfoot den Wert des Parameters eingeben. Kommunikation und Kooperation im Kollegium Qualitätsmerkmal 5. Falls wir das Auto in die Mitte der Welt setzen wollen, können wir schreiben.
youtube
Um zu überprüfen, ob ein Objekt oben am Rand angekommen ist, können Sie schreiben if this. Greendoot dieses Beispiel haben wir diese Arbeit schon gemacht und ein Bild eines Steines im entsprechenden Verzeichnis abgelegt. Höhe der Welt und teilen grenfoot Wert durch zwei.
The post GREENFOOT DOWNLOADEN appeared first on Mezitli.
source http://mezitli.info/greenfoot-11/
0 notes
Text
New code for the cry command
const Discord = require("discord.js");
// const config = require('../botconfig.json') module.exports.run = async (bot, message, args) => { let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kUser) return message.channel.send({embed: { color: 3447003, description: `${mUser.member.displayName} Please use the right Usage \n **USAGE** s!cry [userMention]` }})
if (message.author.id == kUser.id) return message.channel.send("You can't cry on yourself. 😭");
if ("514809633588641792" == kUser.id) return message.channel.send("You can't cry on me :3")
// let options = [""]
// let Random = options[Math.floor(Math.random()*options.length)]
let kissEmbed = new Discord.RichEmbed() .setTitle(`${message.author.username} cries on ${kUser.displayName}'s shoulder`)
.setColor("#f442d7")
.setImage("https://i.imgur.com/hGzdq7C.gif")
message.delete()
message.channel.send(kissEmbed) } module.exports.help = {
name: "cry"
}
1 note
·
View note
Link
The Sole Survivor takes a moment to relax, and ends up teaching Piper something new.
(RSS generated with FetchRss)
0 notes
Text
Processing Code
import processing.serial.*;
Serial myPort;
String val = null;
float num;
TextManager t; int textsize = 10; color blackfield = #000000; color whitefield = #FFFFFF; boolean blackNotWhite = false; PImage img;
void setup() { size(500, 639); colorMode(HSB, width, height, 100); clearScreen(); t = new TextManager(); textSize(textsize); textAlign(CENTER, CENTER); frameRate(900); // change if paint events seem to be too rapid curPaintMode = 2; // paint with background color. setImage(4);
String portName = Serial.list()[1]; myPort = new Serial(this, portName, 9600);
}
void draw() {
while ( myPort.available() > 0) { // If data is available,
val = myPort.readStringUntil('\n'); // read it and store it in
if (val != null) {
println(val);
num = float(val); //convert val into a float in the name of num
if (num <100) { toggleAutoPaintMode(); break;
} else { fill(255); rect(0,0,500,639);
}
}
}
if (autoPaintMode) { autoPaintRegion(0, 0, width, height); return; }
if (mousePressed && mouseY > 0 && mouseY < height && mouseX > 0 && mouseX < width) { paintWordAtPoint(mouseX, mouseY); }
}
void paintWordAtPoint(int locX, int locY) {
// absolute positioning float offX = getJitter(), offY = getJitter(); setFill(locX + (int)offX, locY +(int)offY); text(t.getWord(), locX + offX, locY + offY);
}
void clearScreen() { color field = blackNotWhite ? whitefield : blackfield; background(field); }
void changeTextsize(int direction) { int step = 5; textsize = (textsize + step*direction); if (textsize < 1) textsize = step; textSize(textsize); }
int jitRange = 20; float getJitter() { return random(-jitRange, jitRange); } void setJitRange(int direction) { int step = 5; jitRange = (jitRange + step*direction); if (jitRange < 1) jitRange = 1; }
// select one of the 4 images // this BEGS for a refactoring /* @pjs preload="001.jpg,002.jpg,003.jpg,004.jpg"; */ void setImage(int image) { switch(image) { case 1: img = loadImage("002.jpg"); break;
case 2: img = loadImage("002.jpg"); break;
case 3: img = loadImage("002.jpg"); break;
case 4: img = loadImage("002.jpg"); break;
}
img.resize(0, height); loadPixels(); }
// print a grid of characters from upper-left to lower-right void paintGrid() { textAlign(LEFT, BOTTOM); int nextX = 0, nextY = 0, yOffset = (int)(textAscent() + textDescent()); char w = t.getChar(); nextY = nextY + yOffset; while (nextX < width && (nextY - yOffset) < height) { // println(w + " : " + nextX + ", " + nextY); setFill(nextX, nextY); text(w, nextX, nextY); nextX = nextX + (int)textWidth(w); w = t.getChar(); if (nextX + (int)textWidth(w) > width) { nextX = 0; nextY = nextY + yOffset; } } textAlign(CENTER, CENTER); }
int paintModes = 3; int curPaintMode = 0; void nextPaintMode(int direction) { curPaintMode = (curPaintMode + direction) % paintModes; if (curPaintMode < 0) curPaintMode = paintModes - 1; }
void setFill(int locX, int locY) {
if (locX < 0) locX = 0; if (locX >= width) locX = width-1; if (locY < 0) locY = 0; if (locY >= height) locY = height-1;
switch(curPaintMode) {
case 0: default: if (blackNotWhite) { fill(0, height, 0); } else { fill(0, 0, 100); }
break;
// this is the one I'm really interested in for the project case 2: int loc = locX + locY * width; // println(loc + "/" + img.pixels.length + " locX: " + locX + " locY: " + locY); float h = hue(img.pixels[loc]); float s = saturation(img.pixels[loc]); float b = brightness(img.pixels[loc]); fill(h, s, b); break;
case 1: // TODO: fill based on... mouseX/MouseY + offset? fill(locX, locY, 100); break; } }
boolean autoPaintMode = false; void toggleAutoPaintMode() { autoPaintMode = !autoPaintMode; }
void autoPaintRegion(int minX, int minY, int maxX, int maxY) { int locX = (int)random(minX, maxX), locY = (int)random(minY, maxY); paintWordAtPoint(locX, locY); }
String save() { String filename = "image.text." + frameCount + ".png"; saveFrame(filename); //println("saved as: " + filename); return filename; }
void keyPressed() {
if (key == CODED) { if (keyCode == UP || keyCode == DOWN) { if (keyCode == UP) { changeTextsize(1); } else { changeTextsize(-1); } } else if (keyCode == RIGHT || keyCode == LEFT) { if (keyCode == RIGHT) { setJitRange(1); } else { setJitRange(-1); } } else if (keyCode == BACKSPACE || keyCode == DELETE) { clearScreen(); }
}
switch(key) {
case '1': setImage(1); break;
case '2': setImage(2); break;
case '3': setImage(3); break;
case '4': setImage(4); break;
case 'a': toggleAutoPaintMode(); break;
case 'c': clearScreen(); break;
case 'g': paintGrid(); break;
case 'm': nextPaintMode(1); break; case 'M': nextPaintMode(-1); break;
case 's': save(); break;
case 'x': case 'X': blackNotWhite = !blackNotWhite; setFill(mouseX, mouseY); break;
// not working in processing.js case DELETE: case BACKSPACE: clearScreen(); break; }
}
class TextManager {
String w = ""; String defaultText = "Love many things, for therein lies the true strength, and whosoever loves much performs much, and can accomplish much, and what is done in love is done well."; String SPLIT_TOKENS = " ?.,;:[]<>()\""; String words[]; int charIndex = 0; int wordIndex = 0;
TextManager() { w = defaultText; words = splitTokens(w,SPLIT_TOKENS); }
TextManager(String wInput) { w = wInput; words = splitTokens(w, SPLIT_TOKENS); }
// getChar and getWord indexes are not yoked together char getChar() { char c = w.charAt(charIndex); charIndex = (charIndex + 1) % w.length(); return c; }
String getWord() { String word = words[wordIndex]; wordIndex = (wordIndex + 1) % words.length; return word; }
}
0 notes
Text
Image Cacher in iOS
Image Cacher in iOS
@interface CachedImage : NSObject @property (strong, nonatomic) NSCache *imageCache; + (CachedImage *)shared; ///Set image for key - (void)setImage:(UIImage *)image forKey:(NSString *)key; ///Get image for key - (UIImage *)imageForKey:(NSString *)key; @end #import "CachedImage.h" static CachedImage *shared; @implementation CachedImage @synthesize imageCache; + (CachedImage *)shared { static…
View On WordPress
#10.#10.1#10.2#8.1#8.2#8.3#8.4#9.0#9.1#9.2#9.3#9.4#APP#Apple#Developer#Developers#Development#forum#how to make an ios app#Ios#iOS 10.0#iOS 10.1#iOS 10.2#iOS 8#iOS 8.1#iOS 8.2#iOS 8.3#iOS 8.4#iOS 9.0#iOS 9.1
0 notes
Photo
Deconstructing the Icongoraphy of Seth
3 notes
·
View notes