Search Results

Search found 10 results on 1 pages for 'jaka prasnikar'.

Page 1/1 | 1 

  • Pygame surfaces and their Rects

    - by Jaka Novak
    I am trying to understand how pygame surfaces work. I am confused about Rect position of Surface object. If I try blit surface on screen at some position then Surface is drawn at right position, but Rect of the surface is still at position (0, 0)... I tried write my own surface class with new rect, but i am not sure if is that right solution. My goal is that i could move surface like image with rect.move() or something like that. If there is any solution to do that i would be happy to read it. Thanks for answer and time for reading this awful English If helps i write some code for better understanding my problem. (run it first, and then uncomment two lines of code and run again to see the diference): import pygame from pygame.locals import * class SurfaceR(pygame.Surface): def __init__(self, size, position): pygame.Surface.__init__(self, size) self.rect = pygame.Rect(position, size) self.position = position self.size = size def get_rect(self): return self.rect def main(): pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption("Screen!?") clock = pygame.time.Clock() fps = 30 white = (255, 255, 255) red = (255, 0, 0) green = (0, 255, 0) blue = (0, 0, 255) surface = pygame.Surface((70,200)) surface.fill(red) surface_re = SurfaceR((300, 50), (100, 300)) surface_re.fill(blue) while True: for event in pygame.event.get(): if event.type == QUIT: return 0 screen.blit(surface, (100,50)) screen.blit(surface_re, surface_re.position) #pygame.draw.rect(screen, white, surface.get_rect()) #pygame.draw.rect(screen, white, surface_re.get_rect()) pygame.display.update() clock.tick(fps) if __name__ == "__main__": main()

    Read the article

  • FTP on Linux "Failed to retrieve directory listing" not firewall issue

    - by Jaka Prasnikar
    I've got an VPS in germany running Debian X64. I have very strange issue. I have ISPConfig CP installed using proftpd and I can not connect to FTP by any means. Few hours ago I've had installed DirectAdmin on CentOS same VPS and same issue. Simply when I connect to FTP server I get these: Status: Resolving address of web02.defikon.com Status: Connecting to 130.255.190.71:21... Status: Connection established, waiting for welcome message... Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- Response: 220-You are user number 1 of 50 allowed. Response: 220-Local time is now 12:15. Server port: 21. Response: 220-This is a private system - No anonymous login Response: 220-IPv6 connections are also welcome on this server. Response: 220 You will be disconnected after 15 minutes of inactivity. Command: USER default1 Response: 331 User default1 OK. Password required Command: PASS ****** Response: 230-User default1 has group access to: client0 sshusers Response: 230 OK. Current restricted directory is / Command: OPTS UTF8 ON Response: 200 OK, UTF-8 enabled Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 "/" is your current location Command: TYPE I Response: 200 TYPE is now 8-bit binary Command: PASV Error: Connection timed out Error: Failed to retrieve directory listing I even tried telnet localhost 21 and the same happends. Once I issue command "LIST" I get time out. I've tried every thing and I can't get this to work =( Please help ! P.S.: iptables is turned off.

    Read the article

  • Fixing LOD gaps, T-junctions

    - by Jaka Jancar
    I'm creating a heightmap renderer. One of the examples for solving gaps when doing LOD I found is this: (from Game Programming Gems 2 - Greg Snook - Simplified Terrain using Interlocking Tiles) Wouldn't this still produce a gap, if the three vertices encircled with red were not co-linear? Shouldn't the middle triangle be split into two, as I marked with the orange line? Am I misunderstanding the problem, or is there a mistake in the example?

    Read the article

  • Choose build configuration for referenced subproject

    - by Jaka Jancar
    I have an iPhone project which references a framework as a subproject. The framework has the following configurations: Debug Release My app has the following configurations: Debug Release Distribution-AdHoc Distribution-AppStore I would like the framework to be built with different configurations, depending on the app configuration: Debug - Debug Release - Release Distribution-AdHoc - Release Distribution-AppStore - Release How can I achieve this?

    Read the article

  • Double-tap or two single-taps?

    - by Jaka Jancar
    What is the time limit for two taps to be considered a double-tap, on the iPhone OS? // Edit: Why is this important? In order to handle single-tap and double-tap differently, Apple's guide says to do performSelector...afterDelay with some 'reasonable' interval on first tap (and cancel it later if the second tap is detected). The problem is that if the interval is too short (0.1), the single tap action will be performed even when double-tapping (if relying only on tapCount, that is). If it's too long (0.8), the user will be waiting unnecessarily for the single-tap to be recognized, when there is no possibility for a double-tap. It has to be exactly the correct number, in order to work optimally, but definitely not smaller, or there's a chance for bugs (simultaneous single-tap and double-tap).

    Read the article

  • Corrupted image if variable is not static

    - by Jaka Jancar
    I'm doing the following: static GLfloat vertices[3][3] = { {0.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, {-1.0, 0.0, 0.0} }; glColor4ub(255, 0, 0, 255); glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, vertices); glDrawArrays(GL_TRIANGLES, 0, 9); glDisableClientState(GL_VERTEX_ARRAY); This works ok: However, if I remove static from vertices and therefore re-create the data on the stack on each rendering, I get the following: This happens both on the simulator and on the device. Should I be keeping the variables around after I call glDrawArrays?

    Read the article

1