#1 new
Jason L Perry

Can't get clicks for undraggable bits.

Reported by Jason L Perry | February 13th, 2010 @ 09:13 AM

It's currently impossible (as far as I can tell) to get clickedBit: called on a Game from BoardUIView if the BitHolder has canDragBit: returning nil. In my game I'd like the player to be able to click on a card (to flip it over), without necessarily being able to move it.

Here you nullify _dragBit:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    // ...
    // Ask holder's and game's permission before dragging:
    if( _oldHolder ) {
        _dragBit = [_oldHolder canDragBit: _dragBit];
        if( _dragBit && ! [_game canBit: _dragBit moveFrom: _oldHolder] ) {
            [_oldHolder cancelDragBit: _dragBit];
            _dragBit = nil;
        }
        if( ! _dragBit ) {
            _oldHolder = ne l;
            Beep();
            return;
        }
    }
    // ...
}

Then later:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    if( _dragBit ) {
        if( _dragMoved ) {
            // ...
        } else {
            // Just a click, without a drag:
            _dropTarget.highlighted = NO;
            _dragBit.pickedUp = NO;
            ChangeSuperlayer(_dragBit, _oldSuperlayer, _oldLayerIndex);
            [_oldHolder cancelDragBit: _dragBit];
            if( ! [_game clickedBit: _dragBit] )
                Beep();
        }
            // ...
    }
}

Barring modifying or subclassing BoardUIView, how can I accomplish getting a clickedBit: without the user being able to drag the card around? I've already disabled the 'picked up' animation by reimplementing setPickedUp: in my card class.

Comments and changes to this ticket

  • Jaye Colley

    Jaye Colley August 19th, 2020 @ 01:22 AM

    May I know what game is this? If you are looking for another game to play, you might want to check out Gacha Club. It is basically gacha life 2. Some of its features include having characters to customize for free which means you don't have to pay for any specific hairstyles and outfits that you want for your character. You can also obtain pets which you can customize as well. Mini-games can be played if you want to unlock special features. It is available for mobile but I'd recommend playing it on PC to avoid lags.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A small framework for building board and card games, using Apple's Core Animation.

Language: Objective-C 2.0
Platform: Mac OS X, iPhone

People watching this ticket

Pages